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(channel): per-Thread writer locks and Agent-written requests (one migration) (#23143)

Arvin Xudc17faa7c1a9
diff --git a/apps/server/src/services/channel/ChannelCoordinator.ts b/apps/server/src/services/channel/ChannelCoordinator.ts
index 53ff6f9f113..44b05ac5074 100644
--- a/apps/server/src/services/channel/ChannelCoordinator.ts
+++ b/apps/server/src/services/channel/ChannelCoordinator.ts
@@ -149,9 +149,10 @@ export class ChannelCoordinator {
try {
await pMap(
- Object.values(groupBy(pending, (job) => job.memberId)),
+ Object.values(groupBy(pending, (job) => `${job.memberId}:${job.threadId ?? ''}`)),
async (jobs) => {
- // Recover earlier runs before claiming this member, without delaying other members.
+ // Recover a branch's earlier runs before claiming in it, without delaying other
+ // members or the member's other branches.
for (const job of jobs) {
if (job.status !== 'queued') {
await this.complete(channelId, job.id, job.operationId ?? undefined);
diff --git a/docs/development/database-schema.dbml b/docs/development/database-schema.dbml
index fedf87cab7b..b70b98cefb0 100644
--- a/docs/development/database-schema.dbml
+++ b/docs/development/database-schema.dbml
@@ -1605,8 +1605,7 @@ table channel_jobs {
(topic_id, published_message_id) [name: 'channel_jobs_topic_idx']
(member_id, status, created_at) [name: 'channel_jobs_member_queue_idx']
lease_expires_at [name: 'channel_jobs_lease_expires_idx']
- member_id [name: 'channel_jobs_active_member_unique', unique]
- (device_id, working_directory) [name: 'channel_jobs_active_directory_unique', unique]
+ (device_id, working_directory) [name: 'channel_jobs_active_directory_idx']
@@ -1645,6 +1644,7 @@ table channel_members {
user_id text
role text
last_read_sequence integer
+ pinned_at "timestamp with time zone"
agent_id text
name text
description text [not null, default: '']
@@ -1710,7 +1710,6 @@ table channel_messages {
-
}
}
@@ -1740,6 +1739,7 @@ table channels {
project_id text
agent_id text
peer_user_id text
+ agent_pair_key text
title text [not null]
sequence integer [not null, default: 0]
status text [not null, default: 'active']
@@ -1754,6 +1754,7 @@ table channels {
indexes {
user_id [name: 'channels_user_id_idx']
(agent_id, user_id, workspace_id) [name: 'channels_direct_unique', unique]
+ (agent_pair_key, user_id, workspace_id) [name: 'channels_agent_pair_unique', unique]
project_id [name: 'channels_project_id_idx']
(workspace_id, visibility) [name: 'channels_workspace_visibility_idx']
@@ -1944,6 +1945,7 @@ table user_contact_tags {
table user_contacts {
id uuid [pk, not null, default: `gen_random_uuid()`]
user_id text [not null]
+ workspace_id text
type text [not null]
contact_user_id text
agent_id text
@@ -1958,6 +1960,7 @@ table user_contacts {
indexes {
(user_id, contact_user_id) [name: 'user_contacts_user_unique', unique]
(user_id, agent_id) [name: 'user_contacts_agent_unique', unique]
+ (workspace_id, agent_id) [name: 'user_contacts_workspace_agent_unique', unique]
contact_user_id [name: 'user_contacts_contact_user_id_idx']
agent_id [name: 'user_contacts_agent_id_idx']
}
diff --git a/packages/database/migrations/0218_channel_and_contacts_schema.sql b/packages/database/migrations/0218_channel_and_contacts_schema.sql
new file mode 100644
index 00000000000..f70ca00e558
--- /dev/null
+++ b/packages/database/migrations/0218_channel_and_contacts_schema.sql
@@ -0,0 +1,13 @@
+DROP INDEX IF EXISTS "channel_jobs_active_member_unique";--> statement-breakpoint
+DROP INDEX IF EXISTS "channel_jobs_active_directory_unique";--> statement-breakpoint
+CREATE INDEX IF NOT EXISTS "channel_jobs_active_directory_idx" ON "channel_jobs" USING btree ("device_id","working_directory") WHERE "channel_jobs"."writer_held";--> statement-breakpoint
+ALTER TABLE "channel_messages" DROP CONSTRAINT IF EXISTS "channel_messages_agent_sender_check";--> statement-breakpoint
+ALTER TABLE "channel_members" ADD COLUMN IF NOT EXISTS "pinned_at" timestamp with time zone;--> statement-breakpoint
+ALTER TABLE "channels" ADD COLUMN IF NOT EXISTS "agent_pair_key" text;--> statement-breakpoint
+CREATE UNIQUE INDEX IF NOT EXISTS "channels_agent_pair_unique" ON "channels" USING btree ("agent_pair_key","user_id",coalesce("workspace_id", '')) WHERE "channels"."agent_pair_key" IS NOT NULL;--> statement-breakpoint
+DROP INDEX IF EXISTS "user_contacts_agent_unique";--> statement-breakpoint
+ALTER TABLE "user_contacts" ADD COLUMN IF NOT EXISTS "workspace_id" text;--> statement-breakpoint
+ALTER TABLE "user_contacts" DROP CONSTRAINT IF EXISTS "user_contacts_workspace_id_workspaces_id_fk";--> statement-breakpoint
+ALTER TABLE "user_contacts" ADD CONSTRAINT "user_contacts_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE UNIQUE INDEX IF NOT EXISTS "user_contacts_workspace_agent_unique" ON "user_contacts" USING btree ("workspace_id","agent_id") WHERE "user_contacts"."agent_id" IS NOT NULL AND "user_contacts"."workspace_id" IS NOT NULL;--> statement-breakpoint
+CREATE UNIQUE INDEX IF NOT EXISTS "user_contacts_agent_unique" ON "user_contacts" USING btree ("user_id","agent_id") WHERE "user_contacts"."agent_id" IS NOT NULL AND "user_contacts"."workspace_id" IS NULL;
diff --git a/packages/database/migrations/meta/0208_snapshot.json b/packages/database/migrations/meta/0218_snapshot.json
similarity index 93%
rename from packages/database/migrations/meta/0208_snapshot.json
rename to packages/database/migrations/meta/0218_snapshot.json
index e1846fbdaa0..259a59fb31c 100644
--- a/packages/database/migrations/meta/0208_snapshot.json
+++ b/packages/database/migrations/meta/0218_snapshot.json
@@ -6,9 +6,9 @@
},
"dialect": "postgresql",
"enums": {},
- "id": "1e746038-7134-4368-b581-34f87c1b9b32",
+ "id": "f333c27e-af69-4fc7-bb95-59bf849ced71",
"policies": {},
- "prevId": "67cd6047-5e05-4943-b7ab-6e9b44f6bff3",
+ "prevId": "44fde6f5-404e-4745-a43d-3fa16db429c8",
"roles": {},
"schemas": {},
"sequences": {
@@ -132,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",
@@ -300,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": {
@@ -366,6 +387,15 @@
"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",
@@ -741,6 +771,450 @@
"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"
+ }
+ ],
+ "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": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
"public.agents": {
"name": "agents",
"schema": "",
@@ -7383,6 +7857,27 @@
"method": "btree",
"with": {}
},
+ "agent_operations_workspace_id_created_at_idx": {
+ "name": "agent_operations_workspace_id_created_at_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
"agent_operations_metadata_idx": {
"name": "agent_operations_metadata_idx",
"columns": [
@@ -10432,8 +10927,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.async_tasks": {
- "name": "async_tasks",
+ "public.artboard_boards": {
+ "name": "artboard_boards",
"schema": "",
"columns": {
"id": {
@@ -10443,26 +10938,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
@@ -10479,24 +11350,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",
@@ -10521,11 +11433,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"
@@ -10536,11 +11481,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"
@@ -10551,17 +11496,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"
@@ -10572,26 +11526,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"
@@ -10599,43 +11554,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": ["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"],
"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": {},
@@ -10644,93 +11672,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",
@@ -10743,17 +11866,69 @@
"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"],
"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"
}
},
"compositePrimaryKeys": {},
@@ -10762,116 +11937,188 @@
"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"],
+ "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"
@@ -10883,141 +12130,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
- }
- },
- "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
+ "notNull": true,
+ "default": "now()"
},
- "secret": {
- "name": "secret",
- "type": "text",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "two_factor_secret_idx": {
- "name": "two_factor_secret_idx",
+ "artboard_pages_artboard_id_idx": {
+ "name": "artboard_pages_artboard_id_idx",
"columns": [
{
- "expression": "secret",
+ "expression": "artboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -11028,8 +12215,8 @@
"method": "btree",
"with": {}
},
- "two_factor_user_id_idx": {
- "name": "two_factor_user_id_idx",
+ "artboard_pages_user_id_idx": {
+ "name": "artboard_pages_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -11042,17 +12229,51 @@
"concurrently": false,
"method": "btree",
"with": {}
+ },
+ "artboard_pages_workspace_id_idx": {
+ "name": "artboard_pages_workspace_id_idx",
+ "columns": [
+ {
+ "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"],
"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"
}
},
"compositePrimaryKeys": {},
@@ -11061,108 +12282,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",
@@ -11170,26 +12373,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"
@@ -11200,43 +12428,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"],
+ "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": {},
@@ -11245,163 +12548,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",
@@ -11419,119 +12655,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"
@@ -11542,145 +12733,116 @@
"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"],
+ "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"],
"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"],
+ "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",
- "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", "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",
+ "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"
},
- "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",
+ "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": {
- "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"]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_member_grants": {
- "name": "channel_member_grants",
+ "public.async_tasks": {
+ "name": "async_tasks",
"schema": "",
"columns": {
"id": {
@@ -11690,64 +12852,51 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "channel_id": {
- "name": "channel_id",
+ "type": {
+ "name": "type",
"type": "text",
"primaryKey": false,
- "notNull": true
- },
- "member_id": {
- "name": "member_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "device_owner_id": {
- "name": "device_owner_id",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "device_id": {
- "name": "device_id",
- "type": "varchar(64)",
+ "error": {
+ "name": "error",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "working_directory": {
- "name": "working_directory",
+ "inference_id": {
+ "name": "inference_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "requested_by_member_id": {
- "name": "requested_by_member_id",
- "type": "uuid",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "status": {
- "name": "status",
+ "workspace_id": {
+ "name": "workspace_id",
"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",
+ "duration": {
+ "name": "duration",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "revoke_reason": {
- "name": "revoke_reason",
- "type": "text",
+ "parent_id": {
+ "name": "parent_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
@@ -11755,8 +12904,15 @@
"name": "metadata",
"type": "jsonb",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": true,
+ "default": "'{}'"
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -11774,26 +12930,41 @@
}
},
"indexes": {
- "channel_member_grants_member_unique": {
- "name": "channel_member_grants_member_unique",
+ "async_tasks_user_id_idx": {
+ "name": "async_tasks_user_id_idx",
"columns": [
{
- "expression": "member_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_member_grants_owner_status_idx": {
- "name": "channel_member_grants_owner_status_idx",
+ "async_tasks_parent_id_idx": {
+ "name": "async_tasks_parent_id_idx",
"columns": [
{
- "expression": "device_owner_id",
+ "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"
@@ -11809,44 +12980,71 @@
"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": {
- "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"],
+ "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"
},
- "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"],
+ "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"
- },
- "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": {},
@@ -11855,111 +13053,94 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_members": {
- "name": "channel_members",
+ "public.accounts": {
+ "name": "accounts",
"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",
+ "access_token": {
+ "name": "access_token",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "access_token_expires_at": {
+ "name": "access_token_expires_at",
+ "type": "timestamp",
"primaryKey": false,
"notNull": false
},
- "role": {
- "name": "role",
+ "account_id": {
+ "name": "account_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "last_read_sequence": {
- "name": "last_read_sequence",
- "type": "integer",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
- "agent_id": {
- "name": "agent_id",
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "id_token": {
+ "name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "name": {
- "name": "name",
+ "password": {
+ "name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "description": {
- "name": "description",
+ "provider_id": {
+ "name": "provider_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "''"
+ "notNull": true
},
- "config": {
- "name": "config",
- "type": "jsonb",
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "refresh_token_expires_at": {
+ "name": "refresh_token_expires_at",
+ "type": "timestamp",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": false
},
- "status": {
- "name": "status",
+ "scope": {
+ "name": "scope",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
- },
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
"updated_at": {
"name": "updated_at",
- "type": "timestamp with time zone",
+ "type": "timestamp",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
}
},
"indexes": {
- "channel_members_channel_user_unique": {
- "name": "channel_members_channel_user_unique",
+ "account_userId_idx": {
+ "name": "account_userId_idx",
"columns": [
- {
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
{
"expression": "user_id",
"isExpression": false,
@@ -11967,32 +13148,122 @@
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"channel_members\".\"user_id\" IS NOT NULL",
+ "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
},
- "channel_members_user_id_idx": {
- "name": "channel_members_user_id_idx",
+ "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": "user_id",
+ "expression": "credentialID",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "channel_members_agent_id_idx": {
- "name": "channel_members_agent_id_idx",
+ "passkey_user_id_idx": {
+ "name": "passkey_user_id_idx",
"columns": [
{
- "expression": "agent_id",
+ "expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12005,111 +13276,88 @@
}
},
"foreignKeys": {
- "channel_members_channel_id_channels_id_fk": {
- "name": "channel_members_channel_id_channels_id_fk",
- "tableFrom": "channel_members",
- "tableTo": "channels",
- "columnsFrom": ["channel_id"],
+ "passkey_userId_users_id_fk": {
+ "name": "passkey_userId_users_id_fk",
+ "tableFrom": "passkey",
+ "tableTo": "users",
+ "columnsFrom": ["userId"],
"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"]
- }
- },
+ "uniqueConstraints": {},
"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'"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_message_files": {
- "name": "channel_message_files",
+ "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": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "message_id": {
- "name": "message_id",
- "type": "uuid",
+ "impersonated_by": {
+ "name": "impersonated_by",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "file_id": {
- "name": "file_id",
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "token": {
+ "name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
+ "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": {
- "channel_message_files_file_idx": {
- "name": "channel_message_files_file_idx",
+ "auth_session_userId_idx": {
+ "name": "auth_session_userId_idx",
"columns": [
{
- "expression": "file_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12122,20 +13370,11 @@
}
},
"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"],
- "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"],
+ "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"
@@ -12143,119 +13382,195 @@
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
- "channel_message_files_message_file_unique": {
- "name": "channel_message_files_message_file_unique",
+ "auth_sessions_token_unique": {
+ "name": "auth_sessions_token_unique",
"nullsNotDistinct": false,
- "columns": ["message_id", "file_id"]
+ "columns": ["token"]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.channel_messages": {
- "name": "channel_messages",
+ "public.two_factor": {
+ "name": "two_factor",
"schema": "",
"columns": {
+ "backup_codes": {
+ "name": "backup_codes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "channel_id": {
- "name": "channel_id",
+ "secret": {
+ "name": "secret",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "thread_id": {
- "name": "thread_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": 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": {}
},
- "sequence": {
- "name": "sequence",
- "type": "integer",
+ "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
+ "notNull": true,
+ "default": "now()"
},
- "content": {
- "name": "content",
- "type": "text",
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
"primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "id": {
+ "name": "id",
"type": "text",
- "primaryKey": false,
- "notNull": false
+ "primaryKey": true,
+ "notNull": true
},
- "agent_id": {
- "name": "agent_id",
+ "identifier": {
+ "name": "identifier",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "mentions": {
- "name": "mentions",
- "type": "jsonb",
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
"primaryKey": false,
"notNull": true,
- "default": "'[]'::jsonb"
+ "default": "now()"
},
- "request_key": {
- "name": "request_key",
+ "value": {
+ "name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
- },
- "reply_to_id": {
- "name": "reply_to_id",
+ }
+ },
+ "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": false,
- "notNull": false
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "routing_status": {
- "name": "routing_status",
+ "channel_id": {
+ "name": "channel_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "routing_source": {
- "name": "routing_source",
+ "event": {
+ "name": "event",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "routing_reason": {
- "name": "routing_reason",
+ "target_id": {
+ "name": "target_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "routing_attempt": {
- "name": "routing_attempt",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": true
},
- "recipient_member_ids": {
- "name": "recipient_member_ids",
+ "details": {
+ "name": "details",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
- "default": "'[]'::jsonb"
- },
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false,
"default": "'{}'::jsonb"
},
"created_at": {
@@ -12267,50 +13582,8 @@
}
},
"indexes": {
- "channel_messages_sequence_unique": {
- "name": "channel_messages_sequence_unique",
- "columns": [
- {
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sequence",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "channel_messages_request_key_unique": {
- "name": "channel_messages_request_key_unique",
- "columns": [
- {
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "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",
+ "channel_audit_channel_event_idx": {
+ "name": "channel_audit_channel_event_idx",
"columns": [
{
"expression": "channel_id",
@@ -12319,13 +13592,13 @@
"nulls": "last"
},
{
- "expression": "thread_id",
+ "expression": "event",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "sequence",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12336,129 +13609,61 @@
"method": "btree",
"with": {}
},
- "channel_messages_request_sequence_idx": {
- "name": "channel_messages_request_sequence_idx",
+ "channel_audit_target_event_idx": {
+ "name": "channel_audit_target_event_idx",
"columns": [
{
- "expression": "channel_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "thread_id",
+ "expression": "target_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",
+ "expression": "event",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
+ "expression": "created_at",
"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",
+ "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"
- },
- "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",
- "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"],
- "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.channel_jobs": {
+ "name": "channel_jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
"channel_id": {
"name": "channel_id",
@@ -12466,199 +13671,145 @@
"primaryKey": false,
"notNull": true
},
- "root_message_id": {
- "name": "root_message_id",
+ "member_id": {
+ "name": "member_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
- "root_sequence": {
- "name": "root_sequence",
- "type": "integer",
+ "message_id": {
+ "name": "message_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "follower_member_ids": {
- "name": "follower_member_ids",
- "type": "jsonb",
+ "thread_id": {
+ "name": "thread_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "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": "'active'"
+ "default": "'queued'"
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
+ "blocked_reason": {
+ "name": "blocked_reason",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
+ "blocked_code": {
+ "name": "blocked_code",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "created_at": {
- "name": "created_at",
+ "claimed_at": {
+ "name": "claimed_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": {
- "channel_threads_scope_unique": {
- "name": "channel_threads_scope_unique",
- "nullsNotDistinct": false,
- "columns": ["channel_id", "id"]
- }
- },
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.channels": {
- "name": "channels",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true
+ "notNull": false
},
- "user_id": {
- "name": "user_id",
+ "topic_id": {
+ "name": "topic_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
+ "operation_id": {
+ "name": "operation_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "project_id": {
- "name": "project_id",
- "type": "text",
+ "wake": {
+ "name": "wake",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "agent_id": {
- "name": "agent_id",
- "type": "text",
+ "manifest": {
+ "name": "manifest",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "title": {
- "name": "title",
- "type": "text",
+ "execution_config": {
+ "name": "execution_config",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "sequence": {
- "name": "sequence",
- "type": "integer",
+ "device_id": {
+ "name": "device_id",
+ "type": "varchar(64)",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "status": {
- "name": "status",
+ "working_directory": {
+ "name": "working_directory",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": false
},
- "visibility": {
- "name": "visibility",
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lease_owner": {
+ "name": "lease_owner",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'private'"
+ "notNull": false
},
- "config": {
- "name": "config",
- "type": "jsonb",
+ "lease_expires_at": {
+ "name": "lease_expires_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "writer_held": {
+ "name": "writer_held",
+ "type": "boolean",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": true,
+ "default": false
},
- "deleted_at": {
- "name": "deleted_at",
+ "isolated_at": {
+ "name": "isolated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "is_deleted": {
- "name": "is_deleted",
+ "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": {
@@ -12677,11 +13828,38 @@
}
},
"indexes": {
- "channels_user_id_idx": {
- "name": "channels_user_id_idx",
+ "channel_jobs_delivery_unique": {
+ "name": "channel_jobs_delivery_unique",
"columns": [
{
- "expression": "user_id",
+ "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"
@@ -12692,245 +13870,296 @@
"method": "btree",
"with": {}
},
- "channels_direct_unique": {
- "name": "channels_direct_unique",
+ "channel_jobs_continuation_idx": {
+ "name": "channel_jobs_continuation_idx",
"columns": [
{
- "expression": "agent_id",
+ "expression": "member_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "requester_member_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "coalesce(\"workspace_id\", '')",
+ "expression": "thread_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "claimed_at",
+ "isExpression": false,
"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",
+ "channel_jobs_topic_idx": {
+ "name": "channel_jobs_topic_idx",
"columns": [
{
- "expression": "project_id",
+ "expression": "topic_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "published_message_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",
+ "channel_jobs_member_queue_idx": {
+ "name": "channel_jobs_member_queue_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "member_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "visibility",
+ "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": {
- "channels_user_id_users_id_fk": {
- "name": "channels_user_id_users_id_fk",
- "tableFrom": "channels",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "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": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "channels_workspace_id_workspaces_id_fk": {
- "name": "channels_workspace_id_workspaces_id_fk",
- "tableFrom": "channels",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "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": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "channels_project_id_projects_id_fk": {
- "name": "channels_project_id_projects_id_fk",
- "tableFrom": "channels",
- "tableTo": "projects",
- "columnsFrom": ["project_id"],
+ "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"
},
- "channels_agent_id_agents_id_fk": {
- "name": "channels_agent_id_agents_id_fk",
- "tableFrom": "channels",
- "tableTo": "agents",
- "columnsFrom": ["agent_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
+ "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", "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": {},
- "policies": {},
- "checkConstraints": {
- "channels_direct_visibility_check": {
- "name": "channels_direct_visibility_check",
- "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"
+ "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.chat_groups": {
- "name": "chat_groups",
+ "public.channel_member_grants": {
+ "name": "channel_member_grants",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "description": {
- "name": "description",
+ "channel_id": {
+ "name": "channel_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "avatar": {
- "name": "avatar",
- "type": "text",
+ "member_id": {
+ "name": "member_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "background_color": {
- "name": "background_color",
+ "device_owner_id": {
+ "name": "device_owner_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "market_identifier": {
- "name": "market_identifier",
- "type": "text",
+ "device_id": {
+ "name": "device_id",
+ "type": "varchar(64)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "content": {
- "name": "content",
+ "working_directory": {
+ "name": "working_directory",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "editor_data": {
- "name": "editor_data",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "config": {
- "name": "config",
- "type": "jsonb",
+ "requested_by_member_id": {
+ "name": "requested_by_member_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "client_id": {
- "name": "client_id",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'pending'"
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "decided_at": {
+ "name": "decided_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "group_id": {
- "name": "group_id",
+ "revoke_reason": {
+ "name": "revoke_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "pinned": {
- "name": "pinned",
- "type": "boolean",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false,
- "default": false
+ "default": "'{}'::jsonb"
},
- "visibility": {
- "name": "visibility",
- "type": "text",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
- "default": "'public'"
+ "default": "now()"
},
- "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",
- "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",
+ "updated_at": {
+ "name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
@@ -12938,17 +14167,11 @@
}
},
"indexes": {
- "chat_groups_client_id_user_id_unique": {
- "name": "chat_groups_client_id_user_id_unique",
+ "channel_member_grants_member_unique": {
+ "name": "channel_member_grants_member_unique",
"columns": [
{
- "expression": "client_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
+ "expression": "member_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -12959,68 +14182,17 @@
"method": "btree",
"with": {}
},
- "chat_groups_user_id_idx": {
- "name": "chat_groups_user_id_idx",
- "columns": [
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "chat_groups_group_id_idx": {
- "name": "chat_groups_group_id_idx",
- "columns": [
- {
- "expression": "group_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "chat_groups_workspace_id_idx": {
- "name": "chat_groups_workspace_id_idx",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "chat_groups_workspace_visibility_idx": {
- "name": "chat_groups_workspace_visibility_idx",
+ "channel_member_grants_owner_status_idx": {
+ "name": "channel_member_grants_owner_status_idx",
"columns": [
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "visibility",
+ "expression": "device_owner_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13033,31 +14205,40 @@
}
},
"foreignKeys": {
- "chat_groups_user_id_users_id_fk": {
- "name": "chat_groups_user_id_users_id_fk",
- "tableFrom": "chat_groups",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "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"
},
- "chat_groups_workspace_id_workspaces_id_fk": {
- "name": "chat_groups_workspace_id_workspaces_id_fk",
- "tableFrom": "chat_groups",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "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"
},
- "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",
+ "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"
}
},
@@ -13067,18 +14248,25 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.chat_groups_agents": {
- "name": "chat_groups_agents",
+ "public.channel_members": {
+ "name": "channel_members",
"schema": "",
"columns": {
- "chat_group_id": {
- "name": "chat_group_id",
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "channel_id": {
+ "name": "channel_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "agent_id": {
- "name": "agent_id",
+ "actor_type": {
+ "name": "actor_type",
"type": "text",
"primaryKey": false,
"notNull": true
@@ -13087,41 +14275,64 @@
"name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
+ "role": {
+ "name": "role",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
- "type": "boolean",
+ "last_read_sequence": {
+ "name": "last_read_sequence",
+ "type": "integer",
"primaryKey": false,
- "notNull": false,
- "default": true
+ "notNull": false
},
- "order": {
- "name": "order",
- "type": "integer",
+ "pinned_at": {
+ "name": "pinned_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false,
- "default": 0
+ "notNull": false
},
- "role": {
- "name": "role",
+ "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": "'participant'"
+ "default": "'{}'::jsonb"
},
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
+ "status": {
+ "name": "status",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "now()"
+ "default": "'active'"
},
"created_at": {
"name": "created_at",
@@ -13139,8 +14350,30 @@
}
},
"indexes": {
- "chat_groups_agents_user_id_idx": {
- "name": "chat_groups_agents_user_id_idx",
+ "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",
@@ -13154,11 +14387,11 @@
"method": "btree",
"with": {}
},
- "chat_groups_agents_workspace_id_idx": {
- "name": "chat_groups_agents_workspace_id_idx",
+ "channel_members_agent_id_idx": {
+ "name": "channel_members_agent_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13171,56 +14404,156 @@
}
},
"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"],
+ "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"
},
- "chat_groups_agents_agent_id_agents_id_fk": {
- "name": "chat_groups_agents_agent_id_agents_id_fk",
- "tableFrom": "chat_groups_agents",
+ "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": "cascade",
+ "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')"
},
- "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"],
+ "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",
+ "columns": [
+ {
+ "expression": "file_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "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": ["message_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"],
+ "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": {
- "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"]
+ "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": {},
"isRLSEnabled": false
},
- "public.user_connector_tools": {
- "name": "user_connector_tools",
+ "public.channel_messages": {
+ "name": "channel_messages",
"schema": "",
"columns": {
"id": {
@@ -13230,103 +14563,99 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "user_connector_id": {
- "name": "user_connector_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "user_id": {
- "name": "user_id",
+ "channel_id": {
+ "name": "channel_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "thread_id": {
+ "name": "thread_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "tool_name": {
- "name": "tool_name",
- "type": "varchar(255)",
+ "sequence": {
+ "name": "sequence",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "display_name": {
- "name": "display_name",
- "type": "varchar(255)",
+ "content": {
+ "name": "content",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "description": {
- "name": "description",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "input_schema": {
- "name": "input_schema",
- "type": "jsonb",
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "output_schema": {
- "name": "output_schema",
+ "mentions": {
+ "name": "mentions",
"type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "crud_type": {
- "name": "crud_type",
+ "request_key": {
+ "name": "request_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "render_config": {
- "name": "render_config",
- "type": "jsonb",
+ "reply_to_id": {
+ "name": "reply_to_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "permission": {
- "name": "permission",
+ "routing_status": {
+ "name": "routing_status",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "is_work_artifact": {
- "name": "is_work_artifact",
- "type": "boolean",
+ "routing_source": {
+ "name": "routing_source",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": false
+ "notNull": false
},
- "work_artifact_config": {
- "name": "work_artifact_config",
- "type": "jsonb",
+ "routing_reason": {
+ "name": "routing_reason",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "limit_config": {
- "name": "limit_config",
+ "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": false
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
"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()"
+ "notNull": false,
+ "default": "'{}'::jsonb"
},
"created_at": {
"name": "created_at",
@@ -13334,27 +14663,20 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "user_connector_tools_connector_tool_unique": {
- "name": "user_connector_tools_connector_tool_unique",
+ "channel_messages_sequence_unique": {
+ "name": "channel_messages_sequence_unique",
"columns": [
{
- "expression": "user_connector_id",
+ "expression": "channel_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "tool_name",
+ "expression": "sequence",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13365,11 +14687,44 @@
"method": "btree",
"with": {}
},
- "user_connector_tools_user_id_idx": {
- "name": "user_connector_tools_user_id_idx",
+ "channel_messages_request_key_unique": {
+ "name": "channel_messages_request_key_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "channel_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "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"
@@ -13380,165 +14735,317 @@
"method": "btree",
"with": {}
},
- "user_connector_tools_connector_id_idx": {
- "name": "user_connector_tools_connector_id_idx",
+ "channel_messages_request_sequence_idx": {
+ "name": "channel_messages_request_sequence_idx",
"columns": [
{
- "expression": "user_connector_id",
+ "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": {}
},
- "user_connector_tools_workspace_id_idx": {
- "name": "user_connector_tools_workspace_id_idx",
+ "channel_messages_routing_pending_idx": {
+ "name": "channel_messages_routing_pending_idx",
"columns": [
{
- "expression": "workspace_id",
+ "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": {
- "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"],
+ "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"],
"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",
+ "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": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "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"],
+ "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": "cascade",
+ "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": {},
+ "uniqueConstraints": {
+ "channel_messages_scope_unique": {
+ "name": "channel_messages_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
"policies": {},
- "checkConstraints": {},
+ "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"
+ }
+ },
"isRLSEnabled": false
},
- "public.user_connectors": {
- "name": "user_connectors",
+ "public.channel_threads": {
+ "name": "channel_threads",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "user_id": {
- "name": "user_id",
+ "channel_id": {
+ "name": "channel_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "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
},
- "agent_id": {
- "name": "agent_id",
- "type": "text",
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
"primaryKey": false,
"notNull": false
},
- "identifier": {
- "name": "identifier",
- "type": "varchar(255)",
+ "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": {
+ "channel_threads_scope_unique": {
+ "name": "channel_threads_scope_unique",
+ "nullsNotDistinct": false,
+ "columns": ["channel_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.channels": {
+ "name": "channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
"notNull": true
},
- "name": {
- "name": "name",
- "type": "varchar(255)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "source_type": {
- "name": "source_type",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "mcp_server_url": {
- "name": "mcp_server_url",
+ "project_id": {
+ "name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "mcp_connection_type": {
- "name": "mcp_connection_type",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "mcp_stdio_config": {
- "name": "mcp_stdio_config",
- "type": "jsonb",
+ "peer_user_id": {
+ "name": "peer_user_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "status": {
- "name": "status",
+ "agent_pair_key": {
+ "name": "agent_pair_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "is_enabled": {
- "name": "is_enabled",
- "type": "boolean",
+ "sequence": {
+ "name": "sequence",
+ "type": "integer",
"primaryKey": false,
"notNull": true,
- "default": true
+ "default": 0
},
- "oidc_config": {
- "name": "oidc_config",
- "type": "jsonb",
+ "status": {
+ "name": "status",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'active'"
},
- "credentials": {
- "name": "credentials",
+ "visibility": {
+ "name": "visibility",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'private'"
},
- "token_expires_at": {
- "name": "token_expires_at",
- "type": "timestamp with time zone",
+ "config": {
+ "name": "config",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
@@ -13546,14 +15053,20 @@
"name": "metadata",
"type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": false,
+ "default": "'{}'::jsonb"
},
- "accessed_at": {
- "name": "accessed_at",
+ "deleted_at": {
+ "name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -13571,128 +15084,104 @@
}
},
"indexes": {
- "user_connectors_personal_identifier_idx": {
- "name": "user_connectors_personal_identifier_idx",
+ "channels_user_id_idx": {
+ "name": "channels_user_id_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",
+ "channels_direct_unique": {
+ "name": "channels_direct_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "workspace_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "identifier",
- "isExpression": false,
+ "expression": "coalesce(\"workspace_id\", '')",
"asc": true,
+ "isExpression": true,
"nulls": "last"
}
],
- "isUnique": false,
- "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",
+ "isUnique": true,
+ "where": "\"channels\".\"agent_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_agent_identifier_idx": {
- "name": "user_connectors_agent_identifier_idx",
+ "channels_agent_pair_unique": {
+ "name": "channels_agent_pair_unique",
"columns": [
{
- "expression": "agent_id",
+ "expression": "agent_pair_key",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "identifier",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "where": "\"user_connectors\".\"agent_id\" IS NOT NULL",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "user_connectors_user_id_idx": {
- "name": "user_connectors_user_id_idx",
- "columns": [
+ },
{
- "expression": "user_id",
- "isExpression": false,
+ "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": {}
},
- "user_connectors_token_expires_at_idx": {
- "name": "user_connectors_token_expires_at_idx",
+ "channels_project_id_idx": {
+ "name": "channels_project_id_idx",
"columns": [
{
- "expression": "token_expires_at",
+ "expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"channels\".\"project_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_connectors_workspace_id_idx": {
- "name": "user_connectors_workspace_id_idx",
+ "channels_workspace_visibility_idx": {
+ "name": "channels_workspace_visibility_idx",
"columns": [
{
"expression": "workspace_id",
"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": "agent_id",
+ "expression": "visibility",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -13705,102 +15194,181 @@
}
},
"foreignKeys": {
- "user_connectors_user_id_users_id_fk": {
- "name": "user_connectors_user_id_users_id_fk",
- "tableFrom": "user_connectors",
+ "channels_user_id_users_id_fk": {
+ "name": "channels_user_id_users_id_fk",
+ "tableFrom": "channels",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "user_connectors_workspace_id_workspaces_id_fk": {
- "name": "user_connectors_workspace_id_workspaces_id_fk",
- "tableFrom": "user_connectors",
+ "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"
},
- "user_connectors_agent_id_agents_id_fk": {
- "name": "user_connectors_agent_id_agents_id_fk",
- "tableFrom": "user_connectors",
+ "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": {},
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "channels_direct_visibility_check": {
+ "name": "channels_direct_visibility_check",
+ "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"
+ }
+ },
"isRLSEnabled": false
},
- "public.user_installed_plugins": {
- "name": "user_installed_plugins",
+ "public.chat_groups": {
+ "name": "chat_groups",
"schema": "",
"columns": {
- "user_id": {
- "name": "user_id",
+ "id": {
+ "name": "id",
"type": "text",
- "primaryKey": false,
+ "primaryKey": true,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "identifier": {
- "name": "identifier",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "type": {
- "name": "type",
+ "avatar": {
+ "name": "avatar",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "manifest": {
- "name": "manifest",
- "type": "jsonb",
+ "background_color": {
+ "name": "background_color",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "settings": {
- "name": "settings",
- "type": "jsonb",
+ "market_identifier": {
+ "name": "market_identifier",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "custom_params": {
- "name": "custom_params",
- "type": "jsonb",
+ "content": {
+ "name": "content",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "source": {
- "name": "source",
- "type": "varchar(255)",
+ "editor_data": {
+ "name": "editor_data",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
+ "config": {
+ "name": "config",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
+ "client_id": {
+ "name": "client_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
+ },
+ "group_id": {
+ "name": "group_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pinned": {
+ "name": "pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "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",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
@@ -13814,14 +15382,92 @@
}
},
"indexes": {
- "user_installed_plugins_workspace_id_idx": {
- "name": "user_installed_plugins_workspace_id_idx",
+ "chat_groups_client_id_user_id_unique": {
+ "name": "chat_groups_client_id_user_id_unique",
+ "columns": [
+ {
+ "expression": "client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_groups_user_id_idx": {
+ "name": "chat_groups_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_groups_group_id_idx": {
+ "name": "chat_groups_group_id_idx",
+ "columns": [
+ {
+ "expression": "group_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_groups_workspace_id_idx": {
+ "name": "chat_groups_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "chat_groups_workspace_visibility_idx": {
+ "name": "chat_groups_workspace_visibility_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
}
],
"isUnique": false,
@@ -13831,56 +15477,53 @@
}
},
"foreignKeys": {
- "user_installed_plugins_user_id_users_id_fk": {
- "name": "user_installed_plugins_user_id_users_id_fk",
- "tableFrom": "user_installed_plugins",
+ "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"
},
- "user_installed_plugins_workspace_id_workspaces_id_fk": {
- "name": "user_installed_plugins_workspace_id_workspaces_id_fk",
- "tableFrom": "user_installed_plugins",
+ "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"
+ },
+ "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"
}
},
- "compositePrimaryKeys": {
- "user_installed_plugins_user_id_identifier_pk": {
- "name": "user_installed_plugins_user_id_identifier_pk",
- "columns": ["user_id", "identifier"]
- }
- },
+ "compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.dashboard_items": {
- "name": "dashboard_items",
+ "public.chat_groups_agents": {
+ "name": "chat_groups_agents",
"schema": "",
"columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "dashboard_id": {
- "name": "dashboard_id",
- "type": "uuid",
+ "chat_group_id": {
+ "name": "chat_group_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "widget_id": {
- "name": "widget_id",
- "type": "uuid",
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
@@ -13896,19 +15539,27 @@
"primaryKey": false,
"notNull": false
},
- "layout": {
- "name": "layout",
- "type": "jsonb",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
"primaryKey": false,
- "notNull": false
+ "notNull": false,
+ "default": true
},
- "sort_order": {
- "name": "sort_order",
+ "order": {
+ "name": "order",
"type": "integer",
"primaryKey": false,
- "notNull": true,
+ "notNull": false,
"default": 0
},
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'participant'"
+ },
"accessed_at": {
"name": "accessed_at",
"type": "timestamp with time zone",
@@ -13932,65 +15583,8 @@
}
},
"indexes": {
- "dashboard_items_dashboard_id_widget_id_unique": {
- "name": "dashboard_items_dashboard_id_widget_id_unique",
- "columns": [
- {
- "expression": "dashboard_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "widget_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "dashboard_items_dashboard_id_sort_order_idx": {
- "name": "dashboard_items_dashboard_id_sort_order_idx",
- "columns": [
- {
- "expression": "dashboard_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sort_order",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "dashboard_items_widget_id_idx": {
- "name": "dashboard_items_widget_id_idx",
- "columns": [
- {
- "expression": "widget_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "dashboard_items_user_id_idx": {
- "name": "dashboard_items_user_id_idx",
+ "chat_groups_agents_user_id_idx": {
+ "name": "chat_groups_agents_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -14004,8 +15598,8 @@
"method": "btree",
"with": {}
},
- "dashboard_items_workspace_id_idx": {
- "name": "dashboard_items_workspace_id_idx",
+ "chat_groups_agents_workspace_id_idx": {
+ "name": "chat_groups_agents_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -14021,36 +15615,36 @@
}
},
"foreignKeys": {
- "dashboard_items_dashboard_id_dashboards_id_fk": {
- "name": "dashboard_items_dashboard_id_dashboards_id_fk",
- "tableFrom": "dashboard_items",
- "tableTo": "dashboards",
- "columnsFrom": ["dashboard_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"
},
- "dashboard_items_widget_id_widgets_id_fk": {
- "name": "dashboard_items_widget_id_widgets_id_fk",
- "tableFrom": "dashboard_items",
- "tableTo": "widgets",
- "columnsFrom": ["widget_id"],
+ "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"
},
- "dashboard_items_user_id_users_id_fk": {
- "name": "dashboard_items_user_id_users_id_fk",
- "tableFrom": "dashboard_items",
+ "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"
},
- "dashboard_items_workspace_id_workspaces_id_fk": {
- "name": "dashboard_items_workspace_id_workspaces_id_fk",
- "tableFrom": "dashboard_items",
+ "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"],
@@ -14058,14 +15652,19 @@
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {},
+ "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.dashboards": {
- "name": "dashboards",
+ "public.user_connector_tools": {
+ "name": "user_connector_tools",
"schema": "",
"columns": {
"id": {
@@ -14075,6 +15674,12 @@
"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",
@@ -14087,65 +15692,76 @@
"primaryKey": false,
"notNull": false
},
- "project_id": {
- "name": "project_id",
- "type": "text",
+ "tool_name": {
+ "name": "tool_name",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "agent_id": {
- "name": "agent_id",
- "type": "text",
+ "display_name": {
+ "name": "display_name",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "icon": {
- "name": "icon",
- "type": "text",
+ "input_schema": {
+ "name": "input_schema",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
+ "output_schema": {
+ "name": "output_schema",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "metadata": {
- "name": "metadata",
+ "crud_type": {
+ "name": "crud_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "render_config": {
+ "name": "render_config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
+ "permission": {
+ "name": "permission",
"type": "text",
"primaryKey": false,
+ "notNull": true
+ },
+ "is_work_artifact": {
+ "name": "is_work_artifact",
+ "type": "boolean",
+ "primaryKey": false,
"notNull": true,
- "default": "'public'"
+ "default": false
},
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
+ "work_artifact_config": {
+ "name": "work_artifact_config",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
+ "limit_config": {
+ "name": "limit_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
@@ -14172,99 +15788,47 @@
}
},
"indexes": {
- "dashboards_personal_idx": {
- "name": "dashboards_personal_idx",
- "columns": [
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sort_order",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "where": "\"dashboards\".\"workspace_id\" IS NULL AND \"dashboards\".\"project_id\" IS NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "dashboards_workspace_idx": {
- "name": "dashboards_workspace_idx",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sort_order",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "where": "\"dashboards\".\"workspace_id\" IS NOT NULL AND \"dashboards\".\"project_id\" IS NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "dashboards_project_idx": {
- "name": "dashboards_project_idx",
+ "user_connector_tools_connector_tool_unique": {
+ "name": "user_connector_tools_connector_tool_unique",
"columns": [
{
- "expression": "project_id",
+ "expression": "user_connector_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "sort_order",
+ "expression": "tool_name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
- "where": "\"dashboards\".\"project_id\" IS NOT NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "dashboards_agent_idx": {
- "name": "dashboards_agent_idx",
+ "user_connector_tools_user_id_idx": {
+ "name": "user_connector_tools_user_id_idx",
"columns": [
{
- "expression": "agent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "sort_order",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"dashboards\".\"agent_id\" IS NOT NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
"concurrently": false,
"method": "btree",
"with": {}
},
- "dashboards_user_id_idx": {
- "name": "dashboards_user_id_idx",
+ "user_connector_tools_connector_id_idx": {
+ "name": "user_connector_tools_connector_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "user_connector_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14275,8 +15839,8 @@
"method": "btree",
"with": {}
},
- "dashboards_workspace_id_idx": {
- "name": "dashboards_workspace_id_idx",
+ "user_connector_tools_workspace_id_idx": {
+ "name": "user_connector_tools_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -14292,38 +15856,29 @@
}
},
"foreignKeys": {
- "dashboards_user_id_users_id_fk": {
- "name": "dashboards_user_id_users_id_fk",
- "tableFrom": "dashboards",
- "tableTo": "users",
- "columnsFrom": ["user_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"
},
- "dashboards_workspace_id_workspaces_id_fk": {
- "name": "dashboards_workspace_id_workspaces_id_fk",
- "tableFrom": "dashboards",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "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"
},
- "dashboards_project_id_projects_id_fk": {
- "name": "dashboards_project_id_projects_id_fk",
- "tableFrom": "dashboards",
- "tableTo": "projects",
- "columnsFrom": ["project_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "dashboards_agent_id_agents_id_fk": {
- "name": "dashboards_agent_id_agents_id_fk",
- "tableFrom": "dashboards",
- "tableTo": "agents",
- "columnsFrom": ["agent_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"
@@ -14335,8 +15890,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.devices": {
- "name": "devices",
+ "public.user_connectors": {
+ "name": "user_connectors",
"schema": "",
"columns": {
"id": {
@@ -14358,94 +15913,91 @@
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'private'"
- },
- "shared_from_device_id": {
- "name": "shared_from_device_id",
- "type": "varchar(64)",
- "primaryKey": false,
"notNull": false
},
- "device_id": {
- "name": "device_id",
- "type": "varchar(64)",
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "identity_source": {
- "name": "identity_source",
- "type": "varchar(20)",
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "hostname": {
- "name": "hostname",
+ "source_type": {
+ "name": "source_type",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "platform": {
- "name": "platform",
- "type": "varchar(20)",
+ "mcp_server_url": {
+ "name": "mcp_server_url",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "architecture": {
- "name": "architecture",
- "type": "varchar(20)",
+ "mcp_connection_type": {
+ "name": "mcp_connection_type",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
+ "mcp_stdio_config": {
+ "name": "mcp_stdio_config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "friendly_name": {
- "name": "friendly_name",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
+ "notNull": true
+ },
+ "is_enabled": {
+ "name": "is_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "oidc_config": {
+ "name": "oidc_config",
+ "type": "jsonb",
+ "primaryKey": false,
"notNull": false
},
- "default_cwd": {
- "name": "default_cwd",
+ "credentials": {
+ "name": "credentials",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "recent_cwds": {
- "name": "recent_cwds",
- "type": "text[]",
+ "token_expires_at": {
+ "name": "token_expires_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "'{}'"
+ "notNull": false
},
- "working_dirs": {
- "name": "working_dirs",
+ "metadata": {
+ "name": "metadata",
"type": "jsonb",
"primaryKey": false,
- "notNull": false,
- "default": "'[]'::jsonb"
- },
- "first_seen_at": {
- "name": "first_seen_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "last_seen_at": {
- "name": "last_seen_at",
- "type": "timestamp with time zone",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "now()"
+ "default": "'public'"
},
"accessed_at": {
"name": "accessed_at",
@@ -14470,8 +16022,8 @@
}
},
"indexes": {
- "devices_user_id_device_id_unique": {
- "name": "devices_user_id_device_id_unique",
+ "user_connectors_personal_identifier_idx": {
+ "name": "user_connectors_personal_identifier_idx",
"columns": [
{
"expression": "user_id",
@@ -14480,21 +16032,27 @@
"nulls": "last"
},
{
- "expression": "device_id",
+ "expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"devices\".\"workspace_id\" IS NULL",
+ "isUnique": false,
+ "where": "\"user_connectors\".\"workspace_id\" IS NULL AND \"user_connectors\".\"agent_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "devices_workspace_id_device_id_unique": {
- "name": "devices_workspace_id_device_id_unique",
+ "user_connectors_workspace_identifier_idx": {
+ "name": "user_connectors_workspace_identifier_idx",
"columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
{
"expression": "workspace_id",
"isExpression": false,
@@ -14502,20 +16060,42 @@
"nulls": "last"
},
{
- "expression": "device_id",
+ "expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"devices\".\"workspace_id\" IS NOT NULL",
+ "isUnique": false,
+ "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "devices_user_id_idx": {
- "name": "devices_user_id_idx",
+ "user_connectors_agent_identifier_idx": {
+ "name": "user_connectors_agent_identifier_idx",
+ "columns": [
+ {
+ "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": {}
+ },
+ "user_connectors_user_id_idx": {
+ "name": "user_connectors_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -14529,11 +16109,11 @@
"method": "btree",
"with": {}
},
- "devices_workspace_id_idx": {
- "name": "devices_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"
@@ -14544,23 +16124,152 @@
"method": "btree",
"with": {}
},
- "devices_workspace_visibility_idx": {
- "name": "devices_workspace_visibility_idx",
+ "user_connectors_workspace_id_idx": {
+ "name": "user_connectors_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"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": "visibility",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "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",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14573,18 +16282,18 @@
}
},
"foreignKeys": {
- "devices_user_id_users_id_fk": {
- "name": "devices_user_id_users_id_fk",
- "tableFrom": "devices",
+ "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"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "devices_workspace_id_workspaces_id_fk": {
- "name": "devices_workspace_id_workspaces_id_fk",
- "tableFrom": "devices",
+ "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"],
@@ -14592,14 +16301,19 @@
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {},
+ "compositePrimaryKeys": {
+ "user_installed_plugins_user_id_identifier_pk": {
+ "name": "user_installed_plugins_user_id_identifier_pk",
+ "columns": ["user_id", "identifier"]
+ }
+ },
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.document_comment_mentions": {
- "name": "document_comment_mentions",
+ "public.user_contact_requests": {
+ "name": "user_contact_requests",
"schema": "",
"columns": {
"id": {
@@ -14609,23 +16323,43 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "comment_id": {
- "name": "comment_id",
- "type": "uuid",
+ "requester_id": {
+ "name": "requester_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "mentioned_user_id": {
- "name": "mentioned_user_id",
+ "addressee_id": {
+ "name": "addressee_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "message": {
+ "name": "message",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp with time zone",
+ "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",
@@ -14633,41 +16367,49 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "document_comment_mentions_comment_id_mentioned_user_id_unique": {
- "name": "document_comment_mentions_comment_id_mentioned_user_id_unique",
+ "user_contact_requests_pending_unique": {
+ "name": "user_contact_requests_pending_unique",
"columns": [
{
- "expression": "comment_id",
+ "expression": "requester_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "mentioned_user_id",
+ "expression": "addressee_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
+ "where": "\"user_contact_requests\".\"status\" = 'pending'",
"concurrently": false,
"method": "btree",
"with": {}
},
- "document_comment_mentions_mentioned_user_id_created_at_idx": {
- "name": "document_comment_mentions_mentioned_user_id_created_at_idx",
+ "user_contact_requests_addressee_status_idx": {
+ "name": "user_contact_requests_addressee_status_idx",
"columns": [
{
- "expression": "mentioned_user_id",
+ "expression": "addressee_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "created_at",
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14678,11 +16420,17 @@
"method": "btree",
"with": {}
},
- "document_comment_mentions_workspace_id_idx": {
- "name": "document_comment_mentions_workspace_id_idx",
+ "user_contact_requests_requester_status_idx": {
+ "name": "user_contact_requests_requester_status_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "requester_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14695,29 +16443,20 @@
}
},
"foreignKeys": {
- "document_comment_mentions_comment_id_document_comments_id_fk": {
- "name": "document_comment_mentions_comment_id_document_comments_id_fk",
- "tableFrom": "document_comment_mentions",
- "tableTo": "document_comments",
- "columnsFrom": ["comment_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "document_comment_mentions_mentioned_user_id_users_id_fk": {
- "name": "document_comment_mentions_mentioned_user_id_users_id_fk",
- "tableFrom": "document_comment_mentions",
+ "user_contact_requests_requester_id_users_id_fk": {
+ "name": "user_contact_requests_requester_id_users_id_fk",
+ "tableFrom": "user_contact_requests",
"tableTo": "users",
- "columnsFrom": ["mentioned_user_id"],
+ "columnsFrom": ["requester_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_comment_mentions_workspace_id_workspaces_id_fk": {
- "name": "document_comment_mentions_workspace_id_workspaces_id_fk",
- "tableFrom": "document_comment_mentions",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "user_contact_requests_addressee_id_users_id_fk": {
+ "name": "user_contact_requests_addressee_id_users_id_fk",
+ "tableFrom": "user_contact_requests",
+ "tableTo": "users",
+ "columnsFrom": ["addressee_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -14726,11 +16465,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.document_comments": {
- "name": "document_comments",
+ "public.user_contact_tag_assignments": {
+ "name": "user_contact_tag_assignments",
"schema": "",
"columns": {
"id": {
@@ -14740,65 +16484,30 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "parent_comment_id": {
- "name": "parent_comment_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "reply_to_comment_id": {
- "name": "reply_to_comment_id",
+ "tag_id": {
+ "name": "tag_id",
"type": "uuid",
"primaryKey": false,
- "notNull": false
- },
- "author_user_id": {
- "name": "author_user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
"notNull": true
},
- "content": {
- "name": "content",
- "type": "text",
+ "contact_id": {
+ "name": "contact_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "editor_data": {
- "name": "editor_data",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "selection_anchor": {
- "name": "selection_anchor",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "client_id": {
- "name": "client_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "deleted_at": {
- "name": "deleted_at",
+ "accessed_at": {
+ "name": "accessed_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -14816,23 +16525,17 @@
}
},
"indexes": {
- "document_comments_document_id_author_user_id_client_id_unique": {
- "name": "document_comments_document_id_author_user_id_client_id_unique",
+ "user_contact_tag_assignments_tag_id_contact_id_unique": {
+ "name": "user_contact_tag_assignments_tag_id_contact_id_unique",
"columns": [
{
- "expression": "document_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "author_user_id",
+ "expression": "tag_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "client_id",
+ "expression": "contact_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14843,23 +16546,11 @@
"method": "btree",
"with": {}
},
- "document_comments_parent_comment_id_created_at_id_idx": {
- "name": "document_comments_parent_comment_id_created_at_id_idx",
+ "user_contact_tag_assignments_contact_id_idx": {
+ "name": "user_contact_tag_assignments_contact_id_idx",
"columns": [
{
- "expression": "parent_comment_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "id",
+ "expression": "contact_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14870,11 +16561,11 @@
"method": "btree",
"with": {}
},
- "document_comments_reply_to_comment_id_idx": {
- "name": "document_comments_reply_to_comment_id_idx",
+ "user_contact_tag_assignments_user_id_idx": {
+ "name": "user_contact_tag_assignments_user_id_idx",
"columns": [
{
- "expression": "reply_to_comment_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -14884,107 +16575,130 @@
"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"
},
- "document_comments_document_id_created_at_id_idx": {
- "name": "document_comments_document_id_created_at_id_idx",
- "columns": [
- {
- "expression": "document_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
+ "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"
},
- "document_comments_author_user_id_idx": {
- "name": "document_comments_author_user_id_idx",
+ "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": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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_contact_tags_user_id_name_unique": {
+ "name": "user_contact_tags_user_id_name_unique",
"columns": [
{
- "expression": "author_user_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "document_comments_workspace_id_idx": {
- "name": "document_comments_workspace_id_idx",
- "columns": [
+ },
{
- "expression": "workspace_id",
+ "expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "document_comments_document_id_documents_id_fk": {
- "name": "document_comments_document_id_documents_id_fk",
- "tableFrom": "document_comments",
- "tableTo": "documents",
- "columnsFrom": ["document_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "document_comments_parent_comment_id_document_comments_id_fk": {
- "name": "document_comments_parent_comment_id_document_comments_id_fk",
- "tableFrom": "document_comments",
- "tableTo": "document_comments",
- "columnsFrom": ["parent_comment_id"],
- "columnsTo": ["id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "document_comments_reply_to_comment_id_document_comments_id_fk": {
- "name": "document_comments_reply_to_comment_id_document_comments_id_fk",
- "tableFrom": "document_comments",
- "tableTo": "document_comments",
- "columnsFrom": ["reply_to_comment_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "document_comments_author_user_id_users_id_fk": {
- "name": "document_comments_author_user_id_users_id_fk",
- "tableFrom": "document_comments",
+ "user_contact_tags_user_id_users_id_fk": {
+ "name": "user_contact_tags_user_id_users_id_fk",
+ "tableFrom": "user_contact_tags",
"tableTo": "users",
- "columnsFrom": ["author_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "document_comments_workspace_id_workspaces_id_fk": {
- "name": "document_comments_workspace_id_workspaces_id_fk",
- "tableFrom": "document_comments",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -14993,29 +16707,19 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "document_comments_reply_has_no_anchor": {
- "name": "document_comments_reply_has_no_anchor",
- "value": "\"document_comments\".\"parent_comment_id\" IS NULL OR \"document_comments\".\"selection_anchor\" IS NULL"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.document_histories": {
- "name": "document_histories",
+ "public.user_contacts": {
+ "name": "user_contacts",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "varchar(255)",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
- },
- "document_id": {
- "name": "document_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
@@ -15029,82 +16733,145 @@
"primaryKey": false,
"notNull": false
},
- "editor_data": {
- "name": "editor_data",
- "type": "jsonb",
+ "type": {
+ "name": "type",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "save_source": {
- "name": "save_source",
+ "contact_user_id": {
+ "name": "contact_user_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "editor_ids": {
- "name": "editor_ids",
- "type": "text[]",
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "operation_id": {
- "name": "operation_id",
+ "remark": {
+ "name": "remark",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "agent_id": {
- "name": "agent_id",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "saved_at": {
- "name": "saved_at",
+ "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
+ "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": {
- "document_histories_document_id_idx": {
- "name": "document_histories_document_id_idx",
+ "user_contacts_user_unique": {
+ "name": "user_contacts_user_unique",
"columns": [
{
- "expression": "document_id",
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "contact_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "document_histories_user_id_idx": {
- "name": "document_histories_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": {}
},
- "document_histories_workspace_id_idx": {
- "name": "document_histories_workspace_id_idx",
+ "user_contacts_workspace_agent_unique": {
+ "name": "user_contacts_workspace_agent_unique",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_contacts_contact_user_id_idx": {
+ "name": "user_contacts_contact_user_id_idx",
+ "columns": [
+ {
+ "expression": "contact_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
}
],
"isUnique": false,
@@ -15112,11 +16879,11 @@
"method": "btree",
"with": {}
},
- "document_histories_saved_at_idx": {
- "name": "document_histories_saved_at_idx",
+ "user_contacts_agent_id_idx": {
+ "name": "user_contacts_agent_id_idx",
"columns": [
{
- "expression": "saved_at",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -15129,29 +16896,38 @@
}
},
"foreignKeys": {
- "document_histories_document_id_documents_id_fk": {
- "name": "document_histories_document_id_documents_id_fk",
- "tableFrom": "document_histories",
- "tableTo": "documents",
- "columnsFrom": ["document_id"],
+ "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"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_histories_user_id_users_id_fk": {
- "name": "document_histories_user_id_users_id_fk",
- "tableFrom": "document_histories",
+ "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"],
+ "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": ["user_id"],
+ "columnsFrom": ["contact_user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_histories_workspace_id_workspaces_id_fk": {
- "name": "document_histories_workspace_id_workspaces_id_fk",
- "tableFrom": "document_histories",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "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"
@@ -15163,8 +16939,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.document_likes": {
- "name": "document_likes",
+ "public.dashboard_items": {
+ "name": "dashboard_items",
"schema": "",
"columns": {
"id": {
@@ -15174,9 +16950,15 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "document_id": {
- "name": "document_id",
- "type": "text",
+ "dashboard_id": {
+ "name": "dashboard_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "widget_id": {
+ "name": "widget_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
@@ -15190,7 +16972,27 @@
"name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
+ },
+ "layout": {
+ "name": "layout",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -15198,20 +17000,27 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "document_likes_document_id_user_id_unique": {
- "name": "document_likes_document_id_user_id_unique",
+ "dashboard_items_dashboard_id_widget_id_unique": {
+ "name": "dashboard_items_dashboard_id_widget_id_unique",
"columns": [
{
- "expression": "document_id",
+ "expression": "dashboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "widget_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -15222,17 +17031,17 @@
"method": "btree",
"with": {}
},
- "document_likes_document_id_created_at_idx": {
- "name": "document_likes_document_id_created_at_idx",
+ "dashboard_items_dashboard_id_sort_order_idx": {
+ "name": "dashboard_items_dashboard_id_sort_order_idx",
"columns": [
{
- "expression": "document_id",
+ "expression": "dashboard_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "created_at",
+ "expression": "sort_order",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -15243,8 +17052,23 @@
"method": "btree",
"with": {}
},
- "document_likes_user_id_idx": {
- "name": "document_likes_user_id_idx",
+ "dashboard_items_widget_id_idx": {
+ "name": "dashboard_items_widget_id_idx",
+ "columns": [
+ {
+ "expression": "widget_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "dashboard_items_user_id_idx": {
+ "name": "dashboard_items_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -15258,8 +17082,8 @@
"method": "btree",
"with": {}
},
- "document_likes_workspace_id_idx": {
- "name": "document_likes_workspace_id_idx",
+ "dashboard_items_workspace_id_idx": {
+ "name": "dashboard_items_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -15275,27 +17099,36 @@
}
},
"foreignKeys": {
- "document_likes_document_id_documents_id_fk": {
- "name": "document_likes_document_id_documents_id_fk",
- "tableFrom": "document_likes",
- "tableTo": "documents",
- "columnsFrom": ["document_id"],
+ "dashboard_items_dashboard_id_dashboards_id_fk": {
+ "name": "dashboard_items_dashboard_id_dashboards_id_fk",
+ "tableFrom": "dashboard_items",
+ "tableTo": "dashboards",
+ "columnsFrom": ["dashboard_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_likes_user_id_users_id_fk": {
- "name": "document_likes_user_id_users_id_fk",
- "tableFrom": "document_likes",
+ "dashboard_items_widget_id_widgets_id_fk": {
+ "name": "dashboard_items_widget_id_widgets_id_fk",
+ "tableFrom": "dashboard_items",
+ "tableTo": "widgets",
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "dashboard_items_user_id_users_id_fk": {
+ "name": "dashboard_items_user_id_users_id_fk",
+ "tableFrom": "dashboard_items",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_likes_workspace_id_workspaces_id_fk": {
- "name": "document_likes_workspace_id_workspaces_id_fk",
- "tableFrom": "document_likes",
+ "dashboard_items_workspace_id_workspaces_id_fk": {
+ "name": "dashboard_items_workspace_id_workspaces_id_fk",
+ "tableFrom": "dashboard_items",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
@@ -15309,8 +17142,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.document_shares": {
- "name": "document_shares",
+ "public.dashboards": {
+ "name": "dashboards",
"schema": "",
"columns": {
"id": {
@@ -15320,12 +17153,6 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "document_id": {
- "name": "document_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
"user_id": {
"name": "user_id",
"type": "text",
@@ -15338,27 +17165,68 @@
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
+ "project_id": {
+ "name": "project_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'private'"
+ "notNull": false
},
- "permission": {
- "name": "permission",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'read'"
+ "notNull": false
},
- "page_view_count": {
- "name": "page_view_count",
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "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",
@@ -15382,41 +17250,114 @@
}
},
"indexes": {
- "document_shares_document_id_unique": {
- "name": "document_shares_document_id_unique",
+ "dashboards_personal_idx": {
+ "name": "dashboards_personal_idx",
"columns": [
{
- "expression": "document_id",
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sort_order",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
+ "where": "\"dashboards\".\"workspace_id\" IS NULL AND \"dashboards\".\"project_id\" IS NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
"concurrently": false,
"method": "btree",
"with": {}
},
- "document_shares_user_id_idx": {
- "name": "document_shares_user_id_idx",
+ "dashboards_workspace_idx": {
+ "name": "dashboards_workspace_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sort_order",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"dashboards\".\"workspace_id\" IS NOT NULL AND \"dashboards\".\"project_id\" IS NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
"concurrently": false,
"method": "btree",
"with": {}
},
- "document_shares_workspace_id_idx": {
- "name": "document_shares_workspace_id_idx",
+ "dashboards_project_idx": {
+ "name": "dashboards_project_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sort_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"dashboards\".\"project_id\" IS NOT NULL AND \"dashboards\".\"agent_id\" IS NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "dashboards_agent_idx": {
+ "name": "dashboards_agent_idx",
+ "columns": [
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sort_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"dashboards\".\"agent_id\" IS NOT NULL AND \"dashboards\".\"is_deleted\" IS NOT TRUE",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "dashboards_user_id_idx": {
+ "name": "dashboards_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "dashboards_workspace_id_idx": {
+ "name": "dashboards_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -15429,32 +17370,41 @@
}
},
"foreignKeys": {
- "document_shares_document_id_documents_id_fk": {
- "name": "document_shares_document_id_documents_id_fk",
- "tableFrom": "document_shares",
- "tableTo": "documents",
- "columnsFrom": ["document_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "document_shares_user_id_users_id_fk": {
- "name": "document_shares_user_id_users_id_fk",
- "tableFrom": "document_shares",
+ "dashboards_user_id_users_id_fk": {
+ "name": "dashboards_user_id_users_id_fk",
+ "tableFrom": "dashboards",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "document_shares_workspace_id_workspaces_id_fk": {
- "name": "document_shares_workspace_id_workspaces_id_fk",
- "tableFrom": "document_shares",
+ "dashboards_workspace_id_workspaces_id_fk": {
+ "name": "dashboards_workspace_id_workspaces_id_fk",
+ "tableFrom": "dashboards",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "dashboards_project_id_projects_id_fk": {
+ "name": "dashboards_project_id_projects_id_fk",
+ "tableFrom": "dashboards",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "dashboards_agent_id_agents_id_fk": {
+ "name": "dashboards_agent_id_agents_id_fk",
+ "tableFrom": "dashboards",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -15463,8 +17413,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.environments": {
- "name": "environments",
+ "public.devices": {
+ "name": "devices",
"schema": "",
"columns": {
"id": {
@@ -15486,37 +17436,94 @@
"primaryKey": false,
"notNull": false
},
- "name": {
- "name": "name",
- "type": "varchar(255)",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "shared_from_device_id": {
+ "name": "shared_from_device_id",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "device_id": {
+ "name": "device_id",
+ "type": "varchar(64)",
"primaryKey": false,
"notNull": true
},
- "description": {
- "name": "description",
+ "identity_source": {
+ "name": "identity_source",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "hostname": {
+ "name": "hostname",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
- "type": "boolean",
+ "platform": {
+ "name": "platform",
+ "type": "varchar(20)",
"primaryKey": false,
- "notNull": true,
- "default": true
+ "notNull": false
},
- "visibility": {
- "name": "visibility",
+ "architecture": {
+ "name": "architecture",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "friendly_name": {
+ "name": "friendly_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "default_cwd": {
+ "name": "default_cwd",
"type": "text",
"primaryKey": false,
+ "notNull": false
+ },
+ "recent_cwds": {
+ "name": "recent_cwds",
+ "type": "text[]",
+ "primaryKey": false,
"notNull": true,
- "default": "'private'"
+ "default": "'{}'"
},
- "configuration": {
- "name": "configuration",
+ "working_dirs": {
+ "name": "working_dirs",
"type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "first_seen_at": {
+ "name": "first_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "last_seen_at": {
+ "name": "last_seen_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
},
"accessed_at": {
"name": "accessed_at",
@@ -15541,8 +17548,52 @@
}
},
"indexes": {
- "environments_user_id_idx": {
- "name": "environments_user_id_idx",
+ "devices_user_id_device_id_unique": {
+ "name": "devices_user_id_device_id_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"devices\".\"workspace_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "devices_workspace_id_device_id_unique": {
+ "name": "devices_workspace_id_device_id_unique",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"devices\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "devices_user_id_idx": {
+ "name": "devices_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -15556,8 +17607,8 @@
"method": "btree",
"with": {}
},
- "environments_workspace_id_idx": {
- "name": "environments_workspace_id_idx",
+ "devices_workspace_id_idx": {
+ "name": "devices_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -15571,8 +17622,8 @@
"method": "btree",
"with": {}
},
- "environments_workspace_visibility_idx": {
- "name": "environments_workspace_visibility_idx",
+ "devices_workspace_visibility_idx": {
+ "name": "devices_workspace_visibility_idx",
"columns": [
{
"expression": "workspace_id",
@@ -15597,95 +17648,167 @@
"concurrently": false,
"method": "btree",
"with": {}
+ }
+ },
+ "foreignKeys": {
+ "devices_user_id_users_id_fk": {
+ "name": "devices_user_id_users_id_fk",
+ "tableFrom": "devices",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
},
- "environments_user_name_unique": {
- "name": "environments_user_name_unique",
+ "devices_workspace_id_workspaces_id_fk": {
+ "name": "devices_workspace_id_workspaces_id_fk",
+ "tableFrom": "devices",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.document_comment_mentions": {
+ "name": "document_comment_mentions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "comment_id": {
+ "name": "comment_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mentioned_user_id": {
+ "name": "mentioned_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "document_comment_mentions_comment_id_mentioned_user_id_unique": {
+ "name": "document_comment_mentions_comment_id_mentioned_user_id_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "comment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "name",
+ "expression": "mentioned_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"environments\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "environments_workspace_user_name_unique": {
- "name": "environments_workspace_user_name_unique",
+ "document_comment_mentions_mentioned_user_id_created_at_idx": {
+ "name": "document_comment_mentions_mentioned_user_id_created_at_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "mentioned_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_comment_mentions_workspace_id_idx": {
+ "name": "document_comment_mentions_workspace_id_idx",
+ "columns": [
{
- "expression": "name",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"environments\".\"workspace_id\" is not null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "environments_user_id_users_id_fk": {
- "name": "environments_user_id_users_id_fk",
- "tableFrom": "environments",
+ "document_comment_mentions_comment_id_document_comments_id_fk": {
+ "name": "document_comment_mentions_comment_id_document_comments_id_fk",
+ "tableFrom": "document_comment_mentions",
+ "tableTo": "document_comments",
+ "columnsFrom": ["comment_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "document_comment_mentions_mentioned_user_id_users_id_fk": {
+ "name": "document_comment_mentions_mentioned_user_id_users_id_fk",
+ "tableFrom": "document_comment_mentions",
"tableTo": "users",
- "columnsFrom": ["user_id"],
+ "columnsFrom": ["mentioned_user_id"],
"columnsTo": ["id"],
- "onDelete": "restrict",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "environments_workspace_id_workspaces_id_fk": {
- "name": "environments_workspace_id_workspaces_id_fk",
- "tableFrom": "environments",
+ "document_comment_mentions_workspace_id_workspaces_id_fk": {
+ "name": "document_comment_mentions_workspace_id_workspaces_id_fk",
+ "tableFrom": "document_comment_mentions",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
- "onDelete": "restrict",
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "environments_name_not_empty": {
- "name": "environments_name_not_empty",
- "value": "length(btrim(\"environments\".\"name\")) > 0"
- },
- "environments_configuration_object": {
- "name": "environments_configuration_object",
- "value": "jsonb_typeof(\"environments\".\"configuration\") = 'object'"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.environment_instances": {
- "name": "environment_instances",
+ "public.document_comments": {
+ "name": "document_comments",
"schema": "",
"columns": {
"id": {
@@ -15695,98 +17818,65 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "environment_id": {
- "name": "environment_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "name": {
- "name": "name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "kind": {
- "name": "kind",
+ "document_id": {
+ "name": "document_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "device_id": {
- "name": "device_id",
+ "parent_comment_id": {
+ "name": "parent_comment_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
- "provider": {
- "name": "provider",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "provider_scope": {
- "name": "provider_scope",
- "type": "text",
+ "reply_to_comment_id": {
+ "name": "reply_to_comment_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "provider_resource_id": {
- "name": "provider_resource_id",
+ "author_user_id": {
+ "name": "author_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "working_directory": {
- "name": "working_directory",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "configuration_snapshot": {
- "name": "configuration_snapshot",
- "type": "jsonb",
+ "content": {
+ "name": "content",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "configuration": {
- "name": "configuration",
+ "editor_data": {
+ "name": "editor_data",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": true
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'pending'"
- },
- "build_id": {
- "name": "build_id",
- "type": "text",
+ "selection_anchor": {
+ "name": "selection_anchor",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "build_error": {
- "name": "build_error",
+ "client_id": {
+ "name": "client_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "accessed_at": {
- "name": "accessed_at",
+ "deleted_at": {
+ "name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -15804,94 +17894,122 @@
}
},
"indexes": {
- "environment_instances_environment_id_id_unique": {
- "name": "environment_instances_environment_id_id_unique",
+ "document_comments_document_id_author_user_id_client_id_unique": {
+ "name": "document_comments_document_id_author_user_id_client_id_unique",
"columns": [
{
- "expression": "environment_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "environment_instances_device_path_unique": {
- "name": "environment_instances_device_path_unique",
- "columns": [
- {
- "expression": "device_id",
+ "expression": "author_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "working_directory",
+ "expression": "client_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"environment_instances\".\"device_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "environment_instances_provider_path_unique": {
- "name": "environment_instances_provider_path_unique",
+ "document_comments_parent_comment_id_created_at_id_idx": {
+ "name": "document_comments_parent_comment_id_created_at_id_idx",
"columns": [
{
- "expression": "kind",
+ "expression": "parent_comment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "provider",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "provider_scope",
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_comments_reply_to_comment_id_idx": {
+ "name": "document_comments_reply_to_comment_id_idx",
+ "columns": [
{
- "expression": "provider_resource_id",
+ "expression": "reply_to_comment_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_comments_document_id_created_at_id_idx": {
+ "name": "document_comments_document_id_created_at_id_idx",
+ "columns": [
+ {
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "working_directory",
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"environment_instances\".\"device_id\" IS NULL",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "environment_instances_environment_id_idx": {
- "name": "environment_instances_environment_id_idx",
+ "document_comments_author_user_id_idx": {
+ "name": "document_comments_author_user_id_idx",
"columns": [
{
- "expression": "environment_id",
+ "expression": "author_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_comments_workspace_id_idx": {
+ "name": "document_comments_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -15904,22 +18022,49 @@
}
},
"foreignKeys": {
- "environment_instances_environment_id_environments_id_fk": {
- "name": "environment_instances_environment_id_environments_id_fk",
- "tableFrom": "environment_instances",
- "tableTo": "environments",
- "columnsFrom": ["environment_id"],
+ "document_comments_document_id_documents_id_fk": {
+ "name": "document_comments_document_id_documents_id_fk",
+ "tableFrom": "document_comments",
+ "tableTo": "documents",
+ "columnsFrom": ["document_id"],
"columnsTo": ["id"],
- "onDelete": "restrict",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "environment_instances_device_id_devices_id_fk": {
- "name": "environment_instances_device_id_devices_id_fk",
- "tableFrom": "environment_instances",
- "tableTo": "devices",
- "columnsFrom": ["device_id"],
+ "document_comments_parent_comment_id_document_comments_id_fk": {
+ "name": "document_comments_parent_comment_id_document_comments_id_fk",
+ "tableFrom": "document_comments",
+ "tableTo": "document_comments",
+ "columnsFrom": ["parent_comment_id"],
"columnsTo": ["id"],
- "onDelete": "restrict",
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "document_comments_reply_to_comment_id_document_comments_id_fk": {
+ "name": "document_comments_reply_to_comment_id_document_comments_id_fk",
+ "tableFrom": "document_comments",
+ "tableTo": "document_comments",
+ "columnsFrom": ["reply_to_comment_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "document_comments_author_user_id_users_id_fk": {
+ "name": "document_comments_author_user_id_users_id_fk",
+ "tableFrom": "document_comments",
+ "tableTo": "users",
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "document_comments_workspace_id_workspaces_id_fk": {
+ "name": "document_comments_workspace_id_workspaces_id_fk",
+ "tableFrom": "document_comments",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
@@ -15927,219 +18072,260 @@
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
- "environment_instances_name_not_empty": {
- "name": "environment_instances_name_not_empty",
- "value": "length(btrim(\"environment_instances\".\"name\")) > 0"
- },
- "environment_instances_directory_not_empty": {
- "name": "environment_instances_directory_not_empty",
- "value": "length(btrim(\"environment_instances\".\"working_directory\")) > 0"
- },
- "environment_instances_snapshot_object": {
- "name": "environment_instances_snapshot_object",
- "value": "jsonb_typeof(\"environment_instances\".\"configuration_snapshot\") = 'object'"
- },
- "environment_instances_configuration_object": {
- "name": "environment_instances_configuration_object",
- "value": "\"environment_instances\".\"configuration\" IS NULL OR jsonb_typeof(\"environment_instances\".\"configuration\") = 'object'"
- },
- "environment_instances_binding": {
- "name": "environment_instances_binding",
- "value": "(\n \"environment_instances\".\"kind\" = 'device' AND \"environment_instances\".\"device_id\" IS NOT NULL AND \"environment_instances\".\"provider\" IS NULL AND \"environment_instances\".\"provider_scope\" IS NULL AND \"environment_instances\".\"provider_resource_id\" IS NULL\n ) OR (\n \"environment_instances\".\"kind\" <> 'device' AND \"environment_instances\".\"device_id\" IS NULL AND\n \"environment_instances\".\"provider\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider\")) > 0 AND\n \"environment_instances\".\"provider_scope\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider_scope\")) > 0 AND\n \"environment_instances\".\"provider_resource_id\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider_resource_id\")) > 0\n )"
+ "document_comments_reply_has_no_anchor": {
+ "name": "document_comments_reply_has_no_anchor",
+ "value": "\"document_comments\".\"parent_comment_id\" IS NULL OR \"document_comments\".\"selection_anchor\" IS NULL"
}
},
"isRLSEnabled": false
},
- "public.expertise_bindings": {
- "name": "expertise_bindings",
+ "public.document_histories": {
+ "name": "document_histories",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "varchar(255)",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "domain_id": {
- "name": "domain_id",
+ "document_id": {
+ "name": "document_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "agent_id": {
- "name": "agent_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "project_id": {
- "name": "project_id",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "bound_workspace_id": {
- "name": "bound_workspace_id",
- "type": "text",
+ "editor_data": {
+ "name": "editor_data",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "bound_user_id": {
- "name": "bound_user_id",
+ "save_source": {
+ "name": "save_source",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "contribution_mode": {
- "name": "contribution_mode",
- "type": "text",
+ "editor_ids": {
+ "name": "editor_ids",
+ "type": "text[]",
"primaryKey": false,
- "notNull": true,
- "default": "'derive'"
+ "notNull": false
},
- "added_by_user_id": {
- "name": "added_by_user_id",
+ "operation_id": {
+ "name": "operation_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": true
- },
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "default": 0
- },
- "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",
+ "saved_at": {
+ "name": "saved_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": true
}
},
"indexes": {
- "expertise_bindings_agent_domain_unique": {
- "name": "expertise_bindings_agent_domain_unique",
+ "document_histories_document_id_idx": {
+ "name": "document_histories_document_id_idx",
"columns": [
{
- "expression": "agent_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_histories_user_id_idx": {
+ "name": "document_histories_user_id_idx",
+ "columns": [
{
- "expression": "domain_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"expertise_bindings\".\"agent_id\" is not null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_bindings_project_domain_unique": {
- "name": "expertise_bindings_project_domain_unique",
+ "document_histories_workspace_id_idx": {
+ "name": "document_histories_workspace_id_idx",
"columns": [
{
- "expression": "project_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_histories_saved_at_idx": {
+ "name": "document_histories_saved_at_idx",
+ "columns": [
{
- "expression": "domain_id",
+ "expression": "saved_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"expertise_bindings\".\"project_id\" is not null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
+ }
+ },
+ "foreignKeys": {
+ "document_histories_document_id_documents_id_fk": {
+ "name": "document_histories_document_id_documents_id_fk",
+ "tableFrom": "document_histories",
+ "tableTo": "documents",
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
},
- "expertise_bindings_workspace_domain_unique": {
- "name": "expertise_bindings_workspace_domain_unique",
+ "document_histories_user_id_users_id_fk": {
+ "name": "document_histories_user_id_users_id_fk",
+ "tableFrom": "document_histories",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "document_histories_workspace_id_workspaces_id_fk": {
+ "name": "document_histories_workspace_id_workspaces_id_fk",
+ "tableFrom": "document_histories",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.document_likes": {
+ "name": "document_likes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "document_id": {
+ "name": "document_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "document_likes_document_id_user_id_unique": {
+ "name": "document_likes_document_id_user_id_unique",
"columns": [
{
- "expression": "bound_workspace_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "domain_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"expertise_bindings\".\"bound_workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_bindings_user_domain_unique": {
- "name": "expertise_bindings_user_domain_unique",
+ "document_likes_document_id_created_at_idx": {
+ "name": "document_likes_document_id_created_at_idx",
"columns": [
{
- "expression": "bound_user_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "domain_id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"expertise_bindings\".\"bound_user_id\" is not null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_bindings_domain_idx": {
- "name": "expertise_bindings_domain_idx",
+ "document_likes_user_id_idx": {
+ "name": "document_likes_user_id_idx",
"columns": [
{
- "expression": "domain_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -16150,8 +18336,8 @@
"method": "btree",
"with": {}
},
- "expertise_bindings_workspace_id_idx": {
- "name": "expertise_bindings_workspace_id_idx",
+ "document_likes_workspace_id_idx": {
+ "name": "document_likes_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -16167,63 +18353,27 @@
}
},
"foreignKeys": {
- "expertise_bindings_domain_id_expertise_domains_id_fk": {
- "name": "expertise_bindings_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_bindings",
- "tableTo": "expertise_domains",
- "columnsFrom": ["domain_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_bindings_agent_id_agents_id_fk": {
- "name": "expertise_bindings_agent_id_agents_id_fk",
- "tableFrom": "expertise_bindings",
- "tableTo": "agents",
- "columnsFrom": ["agent_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_bindings_project_id_projects_id_fk": {
- "name": "expertise_bindings_project_id_projects_id_fk",
- "tableFrom": "expertise_bindings",
- "tableTo": "projects",
- "columnsFrom": ["project_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_bindings_bound_workspace_id_workspaces_id_fk": {
- "name": "expertise_bindings_bound_workspace_id_workspaces_id_fk",
- "tableFrom": "expertise_bindings",
- "tableTo": "workspaces",
- "columnsFrom": ["bound_workspace_id"],
+ "document_likes_document_id_documents_id_fk": {
+ "name": "document_likes_document_id_documents_id_fk",
+ "tableFrom": "document_likes",
+ "tableTo": "documents",
+ "columnsFrom": ["document_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_bindings_bound_user_id_users_id_fk": {
- "name": "expertise_bindings_bound_user_id_users_id_fk",
- "tableFrom": "expertise_bindings",
+ "document_likes_user_id_users_id_fk": {
+ "name": "document_likes_user_id_users_id_fk",
+ "tableFrom": "document_likes",
"tableTo": "users",
- "columnsFrom": ["bound_user_id"],
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_bindings_added_by_user_id_users_id_fk": {
- "name": "expertise_bindings_added_by_user_id_users_id_fk",
- "tableFrom": "expertise_bindings",
- "tableTo": "users",
- "columnsFrom": ["added_by_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "expertise_bindings_workspace_id_workspaces_id_fk": {
- "name": "expertise_bindings_workspace_id_workspaces_id_fk",
- "tableFrom": "expertise_bindings",
+ "document_likes_workspace_id_workspaces_id_fk": {
+ "name": "document_likes_workspace_id_workspaces_id_fk",
+ "tableFrom": "document_likes",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
@@ -16234,16 +18384,11 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "expertise_bindings_exactly_one_carrier": {
- "name": "expertise_bindings_exactly_one_carrier",
- "value": "(\"expertise_bindings\".\"agent_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"project_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"bound_workspace_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"bound_user_id\" IS NOT NULL)::int = 1"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.expertise_domain_snapshots": {
- "name": "expertise_domain_snapshots",
+ "public.document_shares": {
+ "name": "document_shares",
"schema": "",
"columns": {
"id": {
@@ -16253,156 +18398,73 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "domain_id": {
- "name": "domain_id",
+ "document_id": {
+ "name": "document_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "run_id": {
- "name": "run_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "run_index": {
- "name": "run_index",
- "type": "integer",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "learned_total": {
- "name": "learned_total",
- "type": "integer",
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "retired_total": {
- "name": "retired_total",
- "type": "integer",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": 0
+ "default": "'private'"
},
- "active_count": {
- "name": "active_count",
- "type": "integer",
+ "permission": {
+ "name": "permission",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'read'"
},
- "compiled_count": {
- "name": "compiled_count",
+ "page_view_count": {
+ "name": "page_view_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
- "layer_counts": {
- "name": "layer_counts",
- "type": "jsonb",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
- "default": "'{}'::jsonb"
- },
- "p_inf": {
- "name": "p_inf",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "tau": {
- "name": "tau",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
+ "default": "now()"
},
- "maturity": {
- "name": "maturity",
- "type": "numeric",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
- "fit_sample_size": {
- "name": "fit_sample_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "fit_r2": {
- "name": "fit_r2",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "fit_confidence": {
- "name": "fit_confidence",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "fit_computed_at": {
- "name": "fit_computed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "tau_pinned": {
- "name": "tau_pinned",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": false
- },
- "observed_span": {
- "name": "observed_span",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "plateau_kind": {
- "name": "plateau_kind",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "layer_coverage": {
- "name": "layer_coverage",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "canon_coverage": {
- "name": "canon_coverage",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "active_rate": {
- "name": "active_rate",
- "type": "numeric",
- "primaryKey": false,
- "notNull": false
- },
- "captured_at": {
- "name": "captured_at",
- "type": "timestamp with time zone",
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
- "expertise_domain_snapshots_domain_run_index_unique": {
- "name": "expertise_domain_snapshots_domain_run_index_unique",
+ "document_shares_document_id_unique": {
+ "name": "document_shares_document_id_unique",
"columns": [
{
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "run_index",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -16413,17 +18475,11 @@
"method": "btree",
"with": {}
},
- "expertise_domain_snapshots_domain_captured_idx": {
- "name": "expertise_domain_snapshots_domain_captured_idx",
+ "document_shares_user_id_idx": {
+ "name": "document_shares_user_id_idx",
"columns": [
{
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "captured_at",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -16434,49 +18490,48 @@
"method": "btree",
"with": {}
},
- "expertise_domain_snapshots_pending_fit_idx": {
- "name": "expertise_domain_snapshots_pending_fit_idx",
+ "document_shares_workspace_id_idx": {
+ "name": "document_shares_workspace_id_idx",
"columns": [
{
- "expression": "domain_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"expertise_domain_snapshots\".\"fit_computed_at\" is null",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "expertise_domain_snapshots_domain_id_expertise_domains_id_fk": {
- "name": "expertise_domain_snapshots_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_domain_snapshots",
- "tableTo": "expertise_domains",
- "columnsFrom": ["domain_id"],
+ "document_shares_document_id_documents_id_fk": {
+ "name": "document_shares_document_id_documents_id_fk",
+ "tableFrom": "document_shares",
+ "tableTo": "documents",
+ "columnsFrom": ["document_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_domain_snapshots_run_id_expertise_runs_id_fk": {
- "name": "expertise_domain_snapshots_run_id_expertise_runs_id_fk",
- "tableFrom": "expertise_domain_snapshots",
- "tableTo": "expertise_runs",
- "columnsFrom": ["run_id"],
+ "document_shares_user_id_users_id_fk": {
+ "name": "document_shares_user_id_users_id_fk",
+ "tableFrom": "document_shares",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_domain_snapshots_run_domain_fk": {
- "name": "expertise_domain_snapshots_run_domain_fk",
- "tableFrom": "expertise_domain_snapshots",
- "tableTo": "expertise_runs",
- "columnsFrom": ["run_id", "domain_id"],
- "columnsTo": ["id", "domain_id"],
- "onDelete": "no action",
+ "document_shares_workspace_id_workspaces_id_fk": {
+ "name": "document_shares_workspace_id_workspaces_id_fk",
+ "tableFrom": "document_shares",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
@@ -16486,33 +18541,16 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.expertise_domains": {
- "name": "expertise_domains",
+ "public.environments": {
+ "name": "environments",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "varchar(255)",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
- },
- "slug": {
- "name": "slug",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
@@ -16526,115 +18564,37 @@
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'private'"
- },
- "source": {
- "name": "source",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'user'"
- },
- "parent_domain_id": {
- "name": "parent_domain_id",
+ "name": {
+ "name": "name",
"type": "varchar(255)",
"primaryKey": false,
- "notNull": false
- },
- "domain_filter": {
- "name": "domain_filter",
- "type": "text",
- "primaryKey": false,
"notNull": true
},
- "out_of_scope": {
- "name": "out_of_scope",
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "layers": {
- "name": "layers",
- "type": "jsonb",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
"primaryKey": false,
"notNull": true,
- "default": "'[]'::jsonb"
+ "default": true
},
- "layer_source": {
- "name": "layer_source",
+ "visibility": {
+ "name": "visibility",
"type": "text",
"primaryKey": false,
"notNull": true,
- "default": "'invented'"
- },
- "canon_entries": {
- "name": "canon_entries",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
- },
- "canon_document_id": {
- "name": "canon_document_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "flow": {
- "name": "flow",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
- },
- "evidence_spec": {
- "name": "evidence_spec",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
- },
- "lesson_base_document_id": {
- "name": "lesson_base_document_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
+ "default": "'private'"
},
- "anchor_candidates": {
- "name": "anchor_candidates",
+ "configuration": {
+ "name": "configuration",
"type": "jsonb",
"primaryKey": false,
- "notNull": false
- },
- "anchor_chosen_at": {
- "name": "anchor_chosen_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "anchor_chosen_by_user_id": {
- "name": "anchor_chosen_by_user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "seed_state": {
- "name": "seed_state",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'seeding'"
- },
- "seed_run_id": {
- "name": "seed_run_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
+ "notNull": true
},
"accessed_at": {
"name": "accessed_at",
@@ -16659,30 +18619,38 @@
}
},
"indexes": {
- "expertise_domains_slug_user_unique": {
- "name": "expertise_domains_slug_user_unique",
+ "environments_user_id_idx": {
+ "name": "environments_user_id_idx",
"columns": [
{
- "expression": "slug",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "environments_workspace_id_idx": {
+ "name": "environments_workspace_id_idx",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"expertise_domains\".\"workspace_id\" is null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_domains_slug_workspace_unique": {
- "name": "expertise_domains_slug_workspace_unique",
+ "environments_workspace_visibility_idx": {
+ "name": "environments_workspace_visibility_idx",
"columns": [
{
"expression": "workspace_id",
@@ -16691,21 +18659,11 @@
"nulls": "last"
},
{
- "expression": "slug",
+ "expression": "visibility",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"expertise_domains\".\"workspace_id\" is not null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "expertise_domains_user_id_idx": {
- "name": "expertise_domains_user_id_idx",
- "columns": [
+ },
{
"expression": "user_id",
"isExpression": false,
@@ -16718,107 +18676,94 @@
"method": "btree",
"with": {}
},
- "expertise_domains_workspace_visibility_idx": {
- "name": "expertise_domains_workspace_visibility_idx",
+ "environments_user_name_unique": {
+ "name": "environments_user_name_unique",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "visibility",
+ "expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"environments\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_domains_parent_idx": {
- "name": "expertise_domains_parent_idx",
+ "environments_workspace_user_name_unique": {
+ "name": "environments_workspace_user_name_unique",
"columns": [
{
- "expression": "parent_domain_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"environments\".\"workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "expertise_domains_user_id_users_id_fk": {
- "name": "expertise_domains_user_id_users_id_fk",
- "tableFrom": "expertise_domains",
+ "environments_user_id_users_id_fk": {
+ "name": "environments_user_id_users_id_fk",
+ "tableFrom": "environments",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "restrict",
"onUpdate": "no action"
},
- "expertise_domains_workspace_id_workspaces_id_fk": {
- "name": "expertise_domains_workspace_id_workspaces_id_fk",
- "tableFrom": "expertise_domains",
+ "environments_workspace_id_workspaces_id_fk": {
+ "name": "environments_workspace_id_workspaces_id_fk",
+ "tableFrom": "environments",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_domains_parent_domain_id_expertise_domains_id_fk": {
- "name": "expertise_domains_parent_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_domains",
- "tableTo": "expertise_domains",
- "columnsFrom": ["parent_domain_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "expertise_domains_canon_document_id_documents_id_fk": {
- "name": "expertise_domains_canon_document_id_documents_id_fk",
- "tableFrom": "expertise_domains",
- "tableTo": "documents",
- "columnsFrom": ["canon_document_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "expertise_domains_lesson_base_document_id_documents_id_fk": {
- "name": "expertise_domains_lesson_base_document_id_documents_id_fk",
- "tableFrom": "expertise_domains",
- "tableTo": "documents",
- "columnsFrom": ["lesson_base_document_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "expertise_domains_anchor_chosen_by_user_id_users_id_fk": {
- "name": "expertise_domains_anchor_chosen_by_user_id_users_id_fk",
- "tableFrom": "expertise_domains",
- "tableTo": "users",
- "columnsFrom": ["anchor_chosen_by_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "restrict",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "environments_name_not_empty": {
+ "name": "environments_name_not_empty",
+ "value": "length(btrim(\"environments\".\"name\")) > 0"
+ },
+ "environments_configuration_object": {
+ "name": "environments_configuration_object",
+ "value": "jsonb_typeof(\"environments\".\"configuration\") = 'object'"
+ }
+ },
"isRLSEnabled": false
},
- "public.expertise_hits": {
- "name": "expertise_hits",
+ "public.environment_instances": {
+ "name": "environment_instances",
"schema": "",
"columns": {
"id": {
@@ -16828,89 +18773,98 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "run_id": {
- "name": "run_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "lesson_id": {
- "name": "lesson_id",
+ "environment_id": {
+ "name": "environment_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
- "domain_id": {
- "name": "domain_id",
+ "name": {
+ "name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "outcome": {
- "name": "outcome",
+ "kind": {
+ "name": "kind",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "where": {
- "name": "where",
- "type": "text",
+ "device_id": {
+ "name": "device_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "note": {
- "name": "note",
+ "provider": {
+ "name": "provider",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "example": {
- "name": "example",
+ "provider_scope": {
+ "name": "provider_scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "severity": {
- "name": "severity",
+ "provider_resource_id": {
+ "name": "provider_resource_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "evidence_id": {
- "name": "evidence_id",
- "type": "uuid",
+ "working_directory": {
+ "name": "working_directory",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "operation_id": {
- "name": "operation_id",
- "type": "text",
+ "configuration_snapshot": {
+ "name": "configuration_snapshot",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "source_check_result_id": {
- "name": "source_check_result_id",
- "type": "uuid",
+ "configuration": {
+ "name": "configuration",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "source_message_id": {
- "name": "source_message_id",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "build_id": {
+ "name": "build_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "user_decision": {
- "name": "user_decision",
+ "build_error": {
+ "name": "build_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "user_decision_at": {
- "name": "user_decision_at",
+ "accessed_at": {
+ "name": "accessed_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -16918,171 +18872,164 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "expertise_hits_lesson_created_idx": {
- "name": "expertise_hits_lesson_created_idx",
+ "environment_instances_environment_id_id_unique": {
+ "name": "environment_instances_environment_id_id_unique",
"columns": [
{
- "expression": "lesson_id",
+ "expression": "environment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "created_at",
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_hits_run_idx": {
- "name": "expertise_hits_run_idx",
+ "environment_instances_device_path_unique": {
+ "name": "environment_instances_device_path_unique",
"columns": [
{
- "expression": "run_id",
+ "expression": "device_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "working_directory",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"environment_instances\".\"device_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_hits_domain_outcome_idx": {
- "name": "expertise_hits_domain_outcome_idx",
+ "environment_instances_provider_path_unique": {
+ "name": "environment_instances_provider_path_unique",
"columns": [
{
- "expression": "domain_id",
+ "expression": "kind",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "outcome",
+ "expression": "provider",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "expertise_hits_operation_idx": {
- "name": "expertise_hits_operation_idx",
- "columns": [
+ },
{
- "expression": "operation_id",
+ "expression": "provider_scope",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "provider_resource_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "working_directory",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"environment_instances\".\"device_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_hits_source_message_idx": {
- "name": "expertise_hits_source_message_idx",
+ "environment_instances_environment_id_idx": {
+ "name": "environment_instances_environment_id_idx",
"columns": [
{
- "expression": "source_message_id",
+ "expression": "environment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"expertise_hits\".\"source_message_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "expertise_hits_domain_id_expertise_domains_id_fk": {
- "name": "expertise_hits_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "expertise_domains",
- "columnsFrom": ["domain_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_hits_evidence_id_verify_evidence_id_fk": {
- "name": "expertise_hits_evidence_id_verify_evidence_id_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "verify_evidence",
- "columnsFrom": ["evidence_id"],
+ "environment_instances_environment_id_environments_id_fk": {
+ "name": "environment_instances_environment_id_environments_id_fk",
+ "tableFrom": "environment_instances",
+ "tableTo": "environments",
+ "columnsFrom": ["environment_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "restrict",
"onUpdate": "no action"
},
- "expertise_hits_operation_id_agent_operations_id_fk": {
- "name": "expertise_hits_operation_id_agent_operations_id_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "agent_operations",
- "columnsFrom": ["operation_id"],
+ "environment_instances_device_id_devices_id_fk": {
+ "name": "environment_instances_device_id_devices_id_fk",
+ "tableFrom": "environment_instances",
+ "tableTo": "devices",
+ "columnsFrom": ["device_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "restrict",
"onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "environment_instances_name_not_empty": {
+ "name": "environment_instances_name_not_empty",
+ "value": "length(btrim(\"environment_instances\".\"name\")) > 0"
},
- "expertise_hits_source_check_result_id_verify_check_results_id_fk": {
- "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"],
- "onDelete": "set null",
- "onUpdate": "no action"
+ "environment_instances_directory_not_empty": {
+ "name": "environment_instances_directory_not_empty",
+ "value": "length(btrim(\"environment_instances\".\"working_directory\")) > 0"
},
- "expertise_hits_source_message_id_messages_id_fk": {
- "name": "expertise_hits_source_message_id_messages_id_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "messages",
- "columnsFrom": ["source_message_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
+ "environment_instances_snapshot_object": {
+ "name": "environment_instances_snapshot_object",
+ "value": "jsonb_typeof(\"environment_instances\".\"configuration_snapshot\") = 'object'"
},
- "expertise_hits_run_domain_fk": {
- "name": "expertise_hits_run_domain_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "expertise_runs",
- "columnsFrom": ["run_id", "domain_id"],
- "columnsTo": ["id", "domain_id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
+ "environment_instances_configuration_object": {
+ "name": "environment_instances_configuration_object",
+ "value": "\"environment_instances\".\"configuration\" IS NULL OR jsonb_typeof(\"environment_instances\".\"configuration\") = 'object'"
},
- "expertise_hits_lesson_domain_fk": {
- "name": "expertise_hits_lesson_domain_fk",
- "tableFrom": "expertise_hits",
- "tableTo": "expertise_lessons",
- "columnsFrom": ["lesson_id", "domain_id"],
- "columnsTo": ["id", "domain_id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
+ "environment_instances_binding": {
+ "name": "environment_instances_binding",
+ "value": "(\n \"environment_instances\".\"kind\" = 'device' AND \"environment_instances\".\"device_id\" IS NOT NULL AND \"environment_instances\".\"provider\" IS NULL AND \"environment_instances\".\"provider_scope\" IS NULL AND \"environment_instances\".\"provider_resource_id\" IS NULL\n ) OR (\n \"environment_instances\".\"kind\" <> 'device' AND \"environment_instances\".\"device_id\" IS NULL AND\n \"environment_instances\".\"provider\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider\")) > 0 AND\n \"environment_instances\".\"provider_scope\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider_scope\")) > 0 AND\n \"environment_instances\".\"provider_resource_id\" IS NOT NULL AND length(btrim(\"environment_instances\".\"provider_resource_id\")) > 0\n )"
}
},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
"isRLSEnabled": false
},
- "public.expertise_insights": {
- "name": "expertise_insights",
+ "public.expertise_bindings": {
+ "name": "expertise_bindings",
"schema": "",
"columns": {
"id": {
@@ -17096,87 +19043,71 @@
"name": "domain_id",
"type": "varchar(255)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "user_id": {
- "name": "user_id",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
+ "project_id": {
+ "name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "kind": {
- "name": "kind",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "headline": {
- "name": "headline",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "body": {
- "name": "body",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "action_label": {
- "name": "action_label",
+ "bound_workspace_id": {
+ "name": "bound_workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "action_target": {
- "name": "action_target",
- "type": "jsonb",
+ "bound_user_id": {
+ "name": "bound_user_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "evidence": {
- "name": "evidence",
- "type": "jsonb",
+ "contribution_mode": {
+ "name": "contribution_mode",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "'[]'::jsonb"
+ "default": "'derive'"
},
- "confidence": {
- "name": "confidence",
- "type": "real",
+ "added_by_user_id": {
+ "name": "added_by_user_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "status": {
- "name": "status",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": false
},
- "dismiss_reason": {
- "name": "dismiss_reason",
- "type": "text",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": true
},
- "stale_after_run_index": {
- "name": "stale_after_run_index",
+ "sort_order": {
+ "name": "sort_order",
"type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 0
},
- "generated_by_operation_id": {
- "name": "generated_by_operation_id",
- "type": "text",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -17194,38 +19125,99 @@
}
},
"indexes": {
- "expertise_insights_domain_status_idx": {
- "name": "expertise_insights_domain_status_idx",
+ "expertise_bindings_agent_domain_unique": {
+ "name": "expertise_bindings_agent_domain_unique",
"columns": [
+ {
+ "expression": "agent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
{
"expression": "domain_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_bindings\".\"agent_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_bindings_project_domain_unique": {
+ "name": "expertise_bindings_project_domain_unique",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
},
{
- "expression": "status",
+ "expression": "domain_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"expertise_bindings\".\"project_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_insights_user_status_idx": {
- "name": "expertise_insights_user_status_idx",
+ "expertise_bindings_workspace_domain_unique": {
+ "name": "expertise_bindings_workspace_domain_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "bound_workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "status",
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_bindings\".\"bound_workspace_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_bindings_user_domain_unique": {
+ "name": "expertise_bindings_user_domain_unique",
+ "columns": [
+ {
+ "expression": "bound_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_bindings\".\"bound_user_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_bindings_domain_idx": {
+ "name": "expertise_bindings_domain_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17236,8 +19228,8 @@
"method": "btree",
"with": {}
},
- "expertise_insights_workspace_idx": {
- "name": "expertise_insights_workspace_idx",
+ "expertise_bindings_workspace_id_idx": {
+ "name": "expertise_bindings_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -17253,51 +19245,83 @@
}
},
"foreignKeys": {
- "expertise_insights_domain_id_expertise_domains_id_fk": {
- "name": "expertise_insights_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_insights",
+ "expertise_bindings_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_bindings_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_bindings",
"tableTo": "expertise_domains",
"columnsFrom": ["domain_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_insights_user_id_users_id_fk": {
- "name": "expertise_insights_user_id_users_id_fk",
- "tableFrom": "expertise_insights",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "expertise_bindings_agent_id_agents_id_fk": {
+ "name": "expertise_bindings_agent_id_agents_id_fk",
+ "tableFrom": "expertise_bindings",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_insights_workspace_id_workspaces_id_fk": {
- "name": "expertise_insights_workspace_id_workspaces_id_fk",
- "tableFrom": "expertise_insights",
+ "expertise_bindings_project_id_projects_id_fk": {
+ "name": "expertise_bindings_project_id_projects_id_fk",
+ "tableFrom": "expertise_bindings",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_bindings_bound_workspace_id_workspaces_id_fk": {
+ "name": "expertise_bindings_bound_workspace_id_workspaces_id_fk",
+ "tableFrom": "expertise_bindings",
"tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "columnsFrom": ["bound_workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_insights_generated_by_operation_id_agent_operations_id_fk": {
- "name": "expertise_insights_generated_by_operation_id_agent_operations_id_fk",
- "tableFrom": "expertise_insights",
- "tableTo": "agent_operations",
- "columnsFrom": ["generated_by_operation_id"],
+ "expertise_bindings_bound_user_id_users_id_fk": {
+ "name": "expertise_bindings_bound_user_id_users_id_fk",
+ "tableFrom": "expertise_bindings",
+ "tableTo": "users",
+ "columnsFrom": ["bound_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_bindings_added_by_user_id_users_id_fk": {
+ "name": "expertise_bindings_added_by_user_id_users_id_fk",
+ "tableFrom": "expertise_bindings",
+ "tableTo": "users",
+ "columnsFrom": ["added_by_user_id"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
+ },
+ "expertise_bindings_workspace_id_workspaces_id_fk": {
+ "name": "expertise_bindings_workspace_id_workspaces_id_fk",
+ "tableFrom": "expertise_bindings",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "expertise_bindings_exactly_one_carrier": {
+ "name": "expertise_bindings_exactly_one_carrier",
+ "value": "(\"expertise_bindings\".\"agent_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"project_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"bound_workspace_id\" IS NOT NULL)::int + (\"expertise_bindings\".\"bound_user_id\" IS NOT NULL)::int = 1"
+ }
+ },
"isRLSEnabled": false
},
- "public.expertise_lesson_revisions": {
- "name": "expertise_lesson_revisions",
+ "public.expertise_domain_snapshots": {
+ "name": "expertise_domain_snapshots",
"schema": "",
"columns": {
"id": {
@@ -17307,75 +19331,138 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "lesson_id": {
- "name": "lesson_id",
- "type": "uuid",
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "revision": {
- "name": "revision",
+ "run_id": {
+ "name": "run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "run_index": {
+ "name": "run_index",
"type": "integer",
"primaryKey": false,
"notNull": true
},
- "sections": {
- "name": "sections",
- "type": "jsonb",
+ "learned_total": {
+ "name": "learned_total",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "feedback": {
- "name": "feedback",
- "type": "text",
+ "retired_total": {
+ "name": "retired_total",
+ "type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 0
},
- "changed_by": {
- "name": "changed_by",
- "type": "text",
+ "active_count": {
+ "name": "active_count",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "kind": {
- "name": "kind",
- "type": "text",
+ "compiled_count": {
+ "name": "compiled_count",
+ "type": "integer",
"primaryKey": false,
"notNull": true,
- "default": "'user-feedback'"
+ "default": 0
},
- "prev_title": {
- "name": "prev_title",
- "type": "text",
+ "layer_counts": {
+ "name": "layer_counts",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::jsonb"
+ },
+ "p_inf": {
+ "name": "p_inf",
+ "type": "numeric",
"primaryKey": false,
"notNull": false
},
- "evidence": {
- "name": "evidence",
- "type": "jsonb",
+ "tau": {
+ "name": "tau",
+ "type": "numeric",
"primaryKey": false,
"notNull": false
},
- "changed_by_user_id": {
- "name": "changed_by_user_id",
+ "maturity": {
+ "name": "maturity",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "fit_sample_size": {
+ "name": "fit_sample_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "fit_r2": {
+ "name": "fit_r2",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "fit_confidence": {
+ "name": "fit_confidence",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "source_run_id": {
- "name": "source_run_id",
- "type": "uuid",
+ "fit_computed_at": {
+ "name": "fit_computed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "operation_id": {
- "name": "operation_id",
+ "tau_pinned": {
+ "name": "tau_pinned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "observed_span": {
+ "name": "observed_span",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "plateau_kind": {
+ "name": "plateau_kind",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "created_at": {
- "name": "created_at",
+ "layer_coverage": {
+ "name": "layer_coverage",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "canon_coverage": {
+ "name": "canon_coverage",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "active_rate": {
+ "name": "active_rate",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "captured_at": {
+ "name": "captured_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
@@ -17383,17 +19470,17 @@
}
},
"indexes": {
- "expertise_lesson_revisions_lesson_revision_unique": {
- "name": "expertise_lesson_revisions_lesson_revision_unique",
+ "expertise_domain_snapshots_domain_run_index_unique": {
+ "name": "expertise_domain_snapshots_domain_run_index_unique",
"columns": [
{
- "expression": "lesson_id",
+ "expression": "domain_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "revision",
+ "expression": "run_index",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17404,11 +19491,17 @@
"method": "btree",
"with": {}
},
- "expertise_lesson_revisions_lesson_idx": {
- "name": "expertise_lesson_revisions_lesson_idx",
+ "expertise_domain_snapshots_domain_captured_idx": {
+ "name": "expertise_domain_snapshots_domain_captured_idx",
"columns": [
{
- "expression": "lesson_id",
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "captured_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17418,34 +19511,50 @@
"concurrently": false,
"method": "btree",
"with": {}
+ },
+ "expertise_domain_snapshots_pending_fit_idx": {
+ "name": "expertise_domain_snapshots_pending_fit_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"expertise_domain_snapshots\".\"fit_computed_at\" is null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
}
},
"foreignKeys": {
- "expertise_lesson_revisions_lesson_id_expertise_lessons_id_fk": {
- "name": "expertise_lesson_revisions_lesson_id_expertise_lessons_id_fk",
- "tableFrom": "expertise_lesson_revisions",
- "tableTo": "expertise_lessons",
- "columnsFrom": ["lesson_id"],
+ "expertise_domain_snapshots_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_domain_snapshots_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_domain_snapshots",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["domain_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_lesson_revisions_changed_by_user_id_users_id_fk": {
- "name": "expertise_lesson_revisions_changed_by_user_id_users_id_fk",
- "tableFrom": "expertise_lesson_revisions",
- "tableTo": "users",
- "columnsFrom": ["changed_by_user_id"],
+ "expertise_domain_snapshots_run_id_expertise_runs_id_fk": {
+ "name": "expertise_domain_snapshots_run_id_expertise_runs_id_fk",
+ "tableFrom": "expertise_domain_snapshots",
+ "tableTo": "expertise_runs",
+ "columnsFrom": ["run_id"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "expertise_lesson_revisions_operation_id_agent_operations_id_fk": {
- "name": "expertise_lesson_revisions_operation_id_agent_operations_id_fk",
- "tableFrom": "expertise_lesson_revisions",
- "tableTo": "agent_operations",
- "columnsFrom": ["operation_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
+ "expertise_domain_snapshots_run_domain_fk": {
+ "name": "expertise_domain_snapshots_run_domain_fk",
+ "tableFrom": "expertise_domain_snapshots",
+ "tableTo": "expertise_runs",
+ "columnsFrom": ["run_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
+ "onDelete": "no action",
"onUpdate": "no action"
}
},
@@ -17455,215 +19564,3165 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.expertise_lessons": {
- "name": "expertise_lessons",
+ "public.expertise_domains": {
+ "name": "expertise_domains",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "varchar(255)",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "domain_id": {
- "name": "domain_id",
+ "slug": {
+ "name": "slug",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "created_by_user_id": {
- "name": "created_by_user_id",
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "code": {
- "name": "code",
- "type": "varchar(20)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "polarity": {
- "name": "polarity",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "title": {
- "name": "title",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'private'"
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'user'"
+ },
+ "parent_domain_id": {
+ "name": "parent_domain_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain_filter": {
+ "name": "domain_filter",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "sections": {
- "name": "sections",
+ "out_of_scope": {
+ "name": "out_of_scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "layers": {
+ "name": "layers",
"type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "layer": {
- "name": "layer",
+ "layer_source": {
+ "name": "layer_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'invented'"
+ },
+ "canon_entries": {
+ "name": "canon_entries",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "canon_document_id": {
+ "name": "canon_document_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
- "tags": {
- "name": "tags",
- "type": "text[]",
+ "flow": {
+ "name": "flow",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "evidence_spec": {
+ "name": "evidence_spec",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "lesson_base_document_id": {
+ "name": "lesson_base_document_id",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
- "reason_kind": {
- "name": "reason_kind",
- "type": "text",
+ "anchor_candidates": {
+ "name": "anchor_candidates",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "reason_source": {
- "name": "reason_source",
- "type": "text",
+ "anchor_chosen_at": {
+ "name": "anchor_chosen_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "canon_anchor": {
- "name": "canon_anchor",
+ "anchor_chosen_by_user_id": {
+ "name": "anchor_chosen_by_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "origin_run_id": {
- "name": "origin_run_id",
+ "seed_state": {
+ "name": "seed_state",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'seeding'"
+ },
+ "seed_run_id": {
+ "name": "seed_run_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
- "origin_hit_id": {
- "name": "origin_hit_id",
+ "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": {
+ "expertise_domains_slug_user_unique": {
+ "name": "expertise_domains_slug_user_unique",
+ "columns": [
+ {
+ "expression": "slug",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_domains\".\"workspace_id\" is null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_domains_slug_workspace_unique": {
+ "name": "expertise_domains_slug_workspace_unique",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "slug",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_domains\".\"workspace_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_domains_user_id_idx": {
+ "name": "expertise_domains_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_domains_workspace_visibility_idx": {
+ "name": "expertise_domains_workspace_visibility_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": {}
+ },
+ "expertise_domains_parent_idx": {
+ "name": "expertise_domains_parent_idx",
+ "columns": [
+ {
+ "expression": "parent_domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_domains_user_id_users_id_fk": {
+ "name": "expertise_domains_user_id_users_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_domains_workspace_id_workspaces_id_fk": {
+ "name": "expertise_domains_workspace_id_workspaces_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_domains_parent_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_domains_parent_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["parent_domain_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_domains_canon_document_id_documents_id_fk": {
+ "name": "expertise_domains_canon_document_id_documents_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "documents",
+ "columnsFrom": ["canon_document_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_domains_lesson_base_document_id_documents_id_fk": {
+ "name": "expertise_domains_lesson_base_document_id_documents_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "documents",
+ "columnsFrom": ["lesson_base_document_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_domains_anchor_chosen_by_user_id_users_id_fk": {
+ "name": "expertise_domains_anchor_chosen_by_user_id_users_id_fk",
+ "tableFrom": "expertise_domains",
+ "tableTo": "users",
+ "columnsFrom": ["anchor_chosen_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.expertise_hits": {
+ "name": "expertise_hits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "run_id": {
+ "name": "run_id",
"type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "status": {
- "name": "status",
+ "lesson_id": {
+ "name": "lesson_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "outcome": {
+ "name": "outcome",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'active'"
+ "notNull": true
},
- "rejected_reason": {
- "name": "rejected_reason",
+ "where": {
+ "name": "where",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "salvaged_from_id": {
- "name": "salvaged_from_id",
- "type": "uuid",
+ "note": {
+ "name": "note",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "retired_at": {
- "name": "retired_at",
- "type": "timestamp with time zone",
+ "example": {
+ "name": "example",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
+ "severity": {
+ "name": "severity",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "enforcement": {
- "name": "enforcement",
+ "evidence_id": {
+ "name": "evidence_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "operation_id": {
+ "name": "operation_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "direction": {
- "name": "direction",
+ "source_check_result_id": {
+ "name": "source_check_result_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_message_id": {
+ "name": "source_message_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "compilability": {
- "name": "compilability",
+ "user_decision": {
+ "name": "user_decision",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'compilable'"
+ "notNull": false
},
- "backtest": {
- "name": "backtest",
- "type": "jsonb",
+ "user_decision_at": {
+ "name": "user_decision_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "compiled_criterion_id": {
- "name": "compiled_criterion_id",
- "type": "uuid",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "expertise_hits_lesson_created_idx": {
+ "name": "expertise_hits_lesson_created_idx",
+ "columns": [
+ {
+ "expression": "lesson_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_hits_run_idx": {
+ "name": "expertise_hits_run_idx",
+ "columns": [
+ {
+ "expression": "run_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_hits_domain_outcome_idx": {
+ "name": "expertise_hits_domain_outcome_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "outcome",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_hits_operation_idx": {
+ "name": "expertise_hits_operation_idx",
+ "columns": [
+ {
+ "expression": "operation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_hits_source_message_idx": {
+ "name": "expertise_hits_source_message_idx",
+ "columns": [
+ {
+ "expression": "source_message_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"expertise_hits\".\"source_message_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_hits_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_hits_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_evidence_id_verify_evidence_id_fk": {
+ "name": "expertise_hits_evidence_id_verify_evidence_id_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "verify_evidence",
+ "columnsFrom": ["evidence_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_operation_id_agent_operations_id_fk": {
+ "name": "expertise_hits_operation_id_agent_operations_id_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "agent_operations",
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_source_check_result_id_verify_check_results_id_fk": {
+ "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"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_source_message_id_messages_id_fk": {
+ "name": "expertise_hits_source_message_id_messages_id_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "messages",
+ "columnsFrom": ["source_message_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_run_domain_fk": {
+ "name": "expertise_hits_run_domain_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "expertise_runs",
+ "columnsFrom": ["run_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_hits_lesson_domain_fk": {
+ "name": "expertise_hits_lesson_domain_fk",
+ "tableFrom": "expertise_hits",
+ "tableTo": "expertise_lessons",
+ "columnsFrom": ["lesson_id", "domain_id"],
+ "columnsTo": ["id", "domain_id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.expertise_insights": {
+ "name": "expertise_insights",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kind": {
+ "name": "kind",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "headline": {
+ "name": "headline",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "body": {
+ "name": "body",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action_label": {
+ "name": "action_label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "action_target": {
+ "name": "action_target",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evidence": {
+ "name": "evidence",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "confidence": {
+ "name": "confidence",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "dismiss_reason": {
+ "name": "dismiss_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stale_after_run_index": {
+ "name": "stale_after_run_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "generated_by_operation_id": {
+ "name": "generated_by_operation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "expertise_insights_domain_status_idx": {
+ "name": "expertise_insights_domain_status_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_insights_user_status_idx": {
+ "name": "expertise_insights_user_status_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_insights_workspace_idx": {
+ "name": "expertise_insights_workspace_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_insights_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_insights_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_insights",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_insights_user_id_users_id_fk": {
+ "name": "expertise_insights_user_id_users_id_fk",
+ "tableFrom": "expertise_insights",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_insights_workspace_id_workspaces_id_fk": {
+ "name": "expertise_insights_workspace_id_workspaces_id_fk",
+ "tableFrom": "expertise_insights",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_insights_generated_by_operation_id_agent_operations_id_fk": {
+ "name": "expertise_insights_generated_by_operation_id_agent_operations_id_fk",
+ "tableFrom": "expertise_insights",
+ "tableTo": "agent_operations",
+ "columnsFrom": ["generated_by_operation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.expertise_lesson_revisions": {
+ "name": "expertise_lesson_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "lesson_id": {
+ "name": "lesson_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sections": {
+ "name": "sections",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "feedback": {
+ "name": "feedback",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "changed_by": {
+ "name": "changed_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'user-feedback'"
+ },
+ "prev_title": {
+ "name": "prev_title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evidence": {
+ "name": "evidence",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "changed_by_user_id": {
+ "name": "changed_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_run_id": {
+ "name": "source_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "operation_id": {
+ "name": "operation_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "expertise_lesson_revisions_lesson_revision_unique": {
+ "name": "expertise_lesson_revisions_lesson_revision_unique",
+ "columns": [
+ {
+ "expression": "lesson_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "revision",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_lesson_revisions_lesson_idx": {
+ "name": "expertise_lesson_revisions_lesson_idx",
+ "columns": [
+ {
+ "expression": "lesson_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_lesson_revisions_lesson_id_expertise_lessons_id_fk": {
+ "name": "expertise_lesson_revisions_lesson_id_expertise_lessons_id_fk",
+ "tableFrom": "expertise_lesson_revisions",
+ "tableTo": "expertise_lessons",
+ "columnsFrom": ["lesson_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_lesson_revisions_changed_by_user_id_users_id_fk": {
+ "name": "expertise_lesson_revisions_changed_by_user_id_users_id_fk",
+ "tableFrom": "expertise_lesson_revisions",
+ "tableTo": "users",
+ "columnsFrom": ["changed_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_lesson_revisions_operation_id_agent_operations_id_fk": {
+ "name": "expertise_lesson_revisions_operation_id_agent_operations_id_fk",
+ "tableFrom": "expertise_lesson_revisions",
+ "tableTo": "agent_operations",
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.expertise_lessons": {
+ "name": "expertise_lessons",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "polarity": {
+ "name": "polarity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sections": {
+ "name": "sections",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "layer": {
+ "name": "layer",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reason_kind": {
+ "name": "reason_kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reason_source": {
+ "name": "reason_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "canon_anchor": {
+ "name": "canon_anchor",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "origin_run_id": {
+ "name": "origin_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "origin_hit_id": {
+ "name": "origin_hit_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "rejected_reason": {
+ "name": "rejected_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "salvaged_from_id": {
+ "name": "salvaged_from_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retired_at": {
+ "name": "retired_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enforcement": {
+ "name": "enforcement",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "direction": {
+ "name": "direction",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compilability": {
+ "name": "compilability",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'compilable'"
+ },
+ "backtest": {
+ "name": "backtest",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "compiled_criterion_id": {
+ "name": "compiled_criterion_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hit_count": {
+ "name": "hit_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "hit_run_count": {
+ "name": "hit_run_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "false_positive_count": {
+ "name": "false_positive_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_hit_at": {
+ "name": "last_hit_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_hit_run_id": {
+ "name": "last_hit_run_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "generalized_from_ids": {
+ "name": "generalized_from_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "specificity": {
+ "name": "specificity",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "example_count": {
+ "name": "example_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "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": {
+ "expertise_lessons_domain_code_unique": {
+ "name": "expertise_lessons_domain_code_unique",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_lessons_domain_status_hits_idx": {
+ "name": "expertise_lessons_domain_status_hits_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "hit_count",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_lessons_domain_layer_idx": {
+ "name": "expertise_lessons_domain_layer_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "layer",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_lessons_compiled_criterion_idx": {
+ "name": "expertise_lessons_compiled_criterion_idx",
+ "columns": [
+ {
+ "expression": "compiled_criterion_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_lessons_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_lessons_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_lessons",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_lessons_created_by_user_id_users_id_fk": {
+ "name": "expertise_lessons_created_by_user_id_users_id_fk",
+ "tableFrom": "expertise_lessons",
+ "tableTo": "users",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_lessons_salvaged_from_id_expertise_lessons_id_fk": {
+ "name": "expertise_lessons_salvaged_from_id_expertise_lessons_id_fk",
+ "tableFrom": "expertise_lessons",
+ "tableTo": "expertise_lessons",
+ "columnsFrom": ["salvaged_from_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_lessons_compiled_criterion_id_verify_criteria_id_fk": {
+ "name": "expertise_lessons_compiled_criterion_id_verify_criteria_id_fk",
+ "tableFrom": "expertise_lessons",
+ "tableTo": "verify_criteria",
+ "columnsFrom": ["compiled_criterion_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "expertise_lessons_id_domain_unique": {
+ "name": "expertise_lessons_id_domain_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "domain_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.expertise_runs": {
+ "name": "expertise_runs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "domain_id": {
+ "name": "domain_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "run_index": {
+ "name": "run_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_seed_run": {
+ "name": "is_seed_run",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "actor_type": {
+ "name": "actor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "actor_id": {
+ "name": "actor_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "subject_type": {
+ "name": "subject_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "subject_id": {
+ "name": "subject_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "window_start": {
+ "name": "window_start",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "window_end": {
+ "name": "window_end",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reflection_key": {
+ "name": "reflection_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "had_human_in_loop": {
+ "name": "had_human_in_loop",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "instance_count": {
+ "name": "instance_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "refine_count": {
+ "name": "refine_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "new_count": {
+ "name": "new_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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": {
+ "expertise_runs_domain_run_index_unique": {
+ "name": "expertise_runs_domain_run_index_unique",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "run_index",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_runs_domain_reflection_key_unique": {
+ "name": "expertise_runs_domain_reflection_key_unique",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "reflection_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"expertise_runs\".\"reflection_key\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_runs_domain_started_idx": {
+ "name": "expertise_runs_domain_started_idx",
+ "columns": [
+ {
+ "expression": "domain_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "started_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_runs_actor_idx": {
+ "name": "expertise_runs_actor_idx",
+ "columns": [
+ {
+ "expression": "actor_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "actor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "expertise_runs_subject_idx": {
+ "name": "expertise_runs_subject_idx",
+ "columns": [
+ {
+ "expression": "subject_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "subject_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "expertise_runs_domain_id_expertise_domains_id_fk": {
+ "name": "expertise_runs_domain_id_expertise_domains_id_fk",
+ "tableFrom": "expertise_runs",
+ "tableTo": "expertise_domains",
+ "columnsFrom": ["domain_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "expertise_runs_user_id_users_id_fk": {
+ "name": "expertise_runs_user_id_users_id_fk",
+ "tableFrom": "expertise_runs",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "expertise_runs_workspace_id_workspaces_id_fk": {
+ "name": "expertise_runs_workspace_id_workspaces_id_fk",
+ "tableFrom": "expertise_runs",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "expertise_runs_id_domain_unique": {
+ "name": "expertise_runs_id_domain_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "domain_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_favorites": {
+ "name": "user_favorites",
+ "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
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_id": {
+ "name": "target_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "path": {
+ "name": "path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "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_favorites_personal_target_unique": {
+ "name": "user_favorites_personal_target_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"user_favorites\".\"workspace_id\" IS NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_favorites_workspace_target_unique": {
+ "name": "user_favorites_workspace_target_unique",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"user_favorites\".\"workspace_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_favorites_user_id_idx": {
+ "name": "user_favorites_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_favorites_workspace_id_idx": {
+ "name": "user_favorites_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_favorites_user_id_users_id_fk": {
+ "name": "user_favorites_user_id_users_id_fk",
+ "tableFrom": "user_favorites",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_favorites_workspace_id_workspaces_id_fk": {
+ "name": "user_favorites_workspace_id_workspaces_id_fk",
+ "tableFrom": "user_favorites",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.documents": {
+ "name": "documents",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(255)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "filename": {
+ "name": "filename",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_char_count": {
+ "name": "total_char_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "total_line_count": {
+ "name": "total_line_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pages": {
+ "name": "pages",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_type": {
+ "name": "source_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "knowledge_base_id": {
+ "name": "knowledge_base_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "editor_data": {
+ "name": "editor_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "slug": {
+ "name": "slug",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_agent_id": {
+ "name": "created_by_agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "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",
+ "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": {
+ "documents_source_idx": {
+ "name": "documents_source_idx",
+ "columns": [
+ {
+ "expression": "source",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_file_type_idx": {
+ "name": "documents_file_type_idx",
+ "columns": [
+ {
+ "expression": "file_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_source_type_idx": {
+ "name": "documents_source_type_idx",
+ "columns": [
+ {
+ "expression": "source_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_user_id_idx": {
+ "name": "documents_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_file_id_idx": {
+ "name": "documents_file_id_idx",
+ "columns": [
+ {
+ "expression": "file_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_parent_id_idx": {
+ "name": "documents_parent_id_idx",
+ "columns": [
+ {
+ "expression": "parent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_knowledge_base_id_idx": {
+ "name": "documents_knowledge_base_id_idx",
+ "columns": [
+ {
+ "expression": "knowledge_base_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_client_id_user_id_unique": {
+ "name": "documents_client_id_user_id_unique",
+ "columns": [
+ {
+ "expression": "client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_slug_user_id_unique": {
+ "name": "documents_slug_user_id_unique",
+ "columns": [
+ {
+ "expression": "slug",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"documents\".\"workspace_id\" IS NULL AND \"documents\".\"slug\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_workspace_id_idx": {
+ "name": "documents_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_workspace_visibility_idx": {
+ "name": "documents_workspace_visibility_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "documents_slug_workspace_id_unique": {
+ "name": "documents_slug_workspace_id_unique",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "slug",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"documents\".\"workspace_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "documents_file_id_files_id_fk": {
+ "name": "documents_file_id_files_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "documents_knowledge_base_id_knowledge_bases_id_fk": {
+ "name": "documents_knowledge_base_id_knowledge_bases_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "knowledge_bases",
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "documents_parent_id_documents_id_fk": {
+ "name": "documents_parent_id_documents_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "documents",
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "documents_user_id_users_id_fk": {
+ "name": "documents_user_id_users_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "documents_workspace_id_workspaces_id_fk": {
+ "name": "documents_workspace_id_workspaces_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.file_uploads": {
+ "name": "file_uploads",
+ "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
+ },
+ "pathname": {
+ "name": "pathname",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "multipart_upload_id": {
+ "name": "multipart_upload_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "multipart_part_size": {
+ "name": "multipart_part_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "file_uploads_user_scope_status_idx": {
+ "name": "file_uploads_user_scope_status_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "file_uploads_workspace_status_idx": {
+ "name": "file_uploads_workspace_status_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "file_uploads_status_expires_at_idx": {
+ "name": "file_uploads_status_expires_at_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "file_uploads_status_updated_at_id_idx": {
+ "name": "file_uploads_status_updated_at_id_idx",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "file_uploads_live_pathname_unique": {
+ "name": "file_uploads_live_pathname_unique",
+ "columns": [
+ {
+ "expression": "pathname",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"file_uploads\".\"status\" IN ('active', 'cleaning')",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "file_uploads_user_id_users_id_fk": {
+ "name": "file_uploads_user_id_users_id_fk",
+ "tableFrom": "file_uploads",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_uploads_workspace_id_workspaces_id_fk": {
+ "name": "file_uploads_workspace_id_workspaces_id_fk",
+ "tableFrom": "file_uploads",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "file_uploads_file_id_files_id_fk": {
+ "name": "file_uploads_file_id_files_id_fk",
+ "tableFrom": "file_uploads",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.files": {
+ "name": "files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_hash": {
+ "name": "file_hash",
+ "type": "varchar(64)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_id": {
+ "name": "parent_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "chunk_task_id": {
+ "name": "chunk_task_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "embedding_task_id": {
+ "name": "embedding_task_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "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",
+ "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": {
+ "file_hash_idx": {
+ "name": "file_hash_idx",
+ "columns": [
+ {
+ "expression": "file_hash",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_user_id_idx": {
+ "name": "files_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_parent_id_idx": {
+ "name": "files_parent_id_idx",
+ "columns": [
+ {
+ "expression": "parent_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_chunk_task_id_idx": {
+ "name": "files_chunk_task_id_idx",
+ "columns": [
+ {
+ "expression": "chunk_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_embedding_task_id_idx": {
+ "name": "files_embedding_task_id_idx",
+ "columns": [
+ {
+ "expression": "embedding_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_client_id_user_id_unique": {
+ "name": "files_client_id_user_id_unique",
+ "columns": [
+ {
+ "expression": "client_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_workspace_id_idx": {
+ "name": "files_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "files_workspace_visibility_idx": {
+ "name": "files_workspace_visibility_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "files_user_id_users_id_fk": {
+ "name": "files_user_id_users_id_fk",
+ "tableFrom": "files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "files_file_hash_global_files_hash_id_fk": {
+ "name": "files_file_hash_global_files_hash_id_fk",
+ "tableFrom": "files",
+ "tableTo": "global_files",
+ "columnsFrom": ["file_hash"],
+ "columnsTo": ["hash_id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "files_parent_id_documents_id_fk": {
+ "name": "files_parent_id_documents_id_fk",
+ "tableFrom": "files",
+ "tableTo": "documents",
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "files_chunk_task_id_async_tasks_id_fk": {
+ "name": "files_chunk_task_id_async_tasks_id_fk",
+ "tableFrom": "files",
+ "tableTo": "async_tasks",
+ "columnsFrom": ["chunk_task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "files_embedding_task_id_async_tasks_id_fk": {
+ "name": "files_embedding_task_id_async_tasks_id_fk",
+ "tableFrom": "files",
+ "tableTo": "async_tasks",
+ "columnsFrom": ["embedding_task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "files_workspace_id_workspaces_id_fk": {
+ "name": "files_workspace_id_workspaces_id_fk",
+ "tableFrom": "files",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.global_files": {
+ "name": "global_files",
+ "schema": "",
+ "columns": {
+ "hash_id": {
+ "name": "hash_id",
+ "type": "varchar(64)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creator": {
+ "name": "creator",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_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()"
+ }
+ },
+ "indexes": {
+ "global_files_creator_idx": {
+ "name": "global_files_creator_idx",
+ "columns": [
+ {
+ "expression": "creator",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "global_files_creator_users_id_fk": {
+ "name": "global_files_creator_users_id_fk",
+ "tableFrom": "global_files",
+ "tableTo": "users",
+ "columnsFrom": ["creator"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knowledge_base_files": {
+ "name": "knowledge_base_files",
+ "schema": "",
+ "columns": {
+ "knowledge_base_id": {
+ "name": "knowledge_base_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "knowledge_base_files_kb_id_idx": {
+ "name": "knowledge_base_files_kb_id_idx",
+ "columns": [
+ {
+ "expression": "knowledge_base_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knowledge_base_files_user_id_idx": {
+ "name": "knowledge_base_files_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knowledge_base_files_file_id_idx": {
+ "name": "knowledge_base_files_file_id_idx",
+ "columns": [
+ {
+ "expression": "file_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knowledge_base_files_workspace_id_idx": {
+ "name": "knowledge_base_files_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk": {
+ "name": "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk",
+ "tableFrom": "knowledge_base_files",
+ "tableTo": "knowledge_bases",
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knowledge_base_files_file_id_files_id_fk": {
+ "name": "knowledge_base_files_file_id_files_id_fk",
+ "tableFrom": "knowledge_base_files",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knowledge_base_files_user_id_users_id_fk": {
+ "name": "knowledge_base_files_user_id_users_id_fk",
+ "tableFrom": "knowledge_base_files",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "knowledge_base_files_workspace_id_workspaces_id_fk": {
+ "name": "knowledge_base_files_workspace_id_workspaces_id_fk",
+ "tableFrom": "knowledge_base_files",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "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"]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.knowledge_bases": {
+ "name": "knowledge_bases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "hit_count": {
- "name": "hit_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "default": 0
- },
- "hit_run_count": {
- "name": "hit_run_count",
- "type": "integer",
+ "type": {
+ "name": "type",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "false_positive_count": {
- "name": "false_positive_count",
- "type": "integer",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": true
},
- "last_hit_at": {
- "name": "last_hit_at",
- "type": "timestamp with time zone",
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "last_hit_run_id": {
- "name": "last_hit_run_id",
- "type": "uuid",
+ "is_public": {
+ "name": "is_public",
+ "type": "boolean",
"primaryKey": false,
- "notNull": false
+ "notNull": false,
+ "default": false
},
- "generalized_from_ids": {
- "name": "generalized_from_ids",
+ "settings": {
+ "name": "settings",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "specificity": {
- "name": "specificity",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "example_count": {
- "name": "example_count",
- "type": "integer",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": 0
+ "default": "'public'"
},
- "current_revision": {
- "name": "current_revision",
- "type": "integer",
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": 1
+ "notNull": false
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
},
"accessed_at": {
"name": "accessed_at",
@@ -17688,17 +22747,17 @@
}
},
"indexes": {
- "expertise_lessons_domain_code_unique": {
- "name": "expertise_lessons_domain_code_unique",
+ "knowledge_bases_client_id_user_id_unique": {
+ "name": "knowledge_bases_client_id_user_id_unique",
"columns": [
{
- "expression": "domain_id",
+ "expression": "client_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "code",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17709,23 +22768,26 @@
"method": "btree",
"with": {}
},
- "expertise_lessons_domain_status_hits_idx": {
- "name": "expertise_lessons_domain_status_hits_idx",
+ "knowledge_bases_user_id_idx": {
+ "name": "knowledge_bases_user_id_idx",
"columns": [
{
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "knowledge_bases_workspace_id_idx": {
+ "name": "knowledge_bases_workspace_id_idx",
+ "columns": [
{
- "expression": "hit_count",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17736,32 +22798,23 @@
"method": "btree",
"with": {}
},
- "expertise_lessons_domain_layer_idx": {
- "name": "expertise_lessons_domain_layer_idx",
+ "knowledge_bases_workspace_visibility_idx": {
+ "name": "knowledge_bases_workspace_visibility_idx",
"columns": [
{
- "expression": "domain_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "layer",
+ "expression": "visibility",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "expertise_lessons_compiled_criterion_idx": {
- "name": "expertise_lessons_compiled_criterion_idx",
- "columns": [
+ },
{
- "expression": "compiled_criterion_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -17774,139 +22827,52 @@
}
},
"foreignKeys": {
- "expertise_lessons_domain_id_expertise_domains_id_fk": {
- "name": "expertise_lessons_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_lessons",
- "tableTo": "expertise_domains",
- "columnsFrom": ["domain_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "expertise_lessons_created_by_user_id_users_id_fk": {
- "name": "expertise_lessons_created_by_user_id_users_id_fk",
- "tableFrom": "expertise_lessons",
+ "knowledge_bases_user_id_users_id_fk": {
+ "name": "knowledge_bases_user_id_users_id_fk",
+ "tableFrom": "knowledge_bases",
"tableTo": "users",
- "columnsFrom": ["created_by_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "expertise_lessons_salvaged_from_id_expertise_lessons_id_fk": {
- "name": "expertise_lessons_salvaged_from_id_expertise_lessons_id_fk",
- "tableFrom": "expertise_lessons",
- "tableTo": "expertise_lessons",
- "columnsFrom": ["salvaged_from_id"],
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_lessons_compiled_criterion_id_verify_criteria_id_fk": {
- "name": "expertise_lessons_compiled_criterion_id_verify_criteria_id_fk",
- "tableFrom": "expertise_lessons",
- "tableTo": "verify_criteria",
- "columnsFrom": ["compiled_criterion_id"],
+ "knowledge_bases_workspace_id_workspaces_id_fk": {
+ "name": "knowledge_bases_workspace_id_workspaces_id_fk",
+ "tableFrom": "knowledge_bases",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "expertise_lessons_id_domain_unique": {
- "name": "expertise_lessons_id_domain_unique",
- "nullsNotDistinct": false,
- "columns": ["id", "domain_id"]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.expertise_runs": {
- "name": "expertise_runs",
+ "public.file_shares": {
+ "name": "file_shares",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "domain_id": {
- "name": "domain_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "run_index": {
- "name": "run_index",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- },
- "is_seed_run": {
- "name": "is_seed_run",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": false
- },
- "actor_type": {
- "name": "actor_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "actor_id": {
- "name": "actor_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "subject_type": {
- "name": "subject_type",
"type": "text",
- "primaryKey": false,
+ "primaryKey": true,
"notNull": true
},
- "subject_id": {
- "name": "subject_id",
+ "file_id": {
+ "name": "file_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "window_start": {
- "name": "window_start",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "window_end": {
- "name": "window_end",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "reflection_key": {
- "name": "reflection_key",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "had_human_in_loop": {
- "name": "had_human_in_loop",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": false
- },
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
"workspace_id": {
"name": "workspace_id",
@@ -17914,39 +22880,31 @@
"primaryKey": false,
"notNull": false
},
- "instance_count": {
- "name": "instance_count",
+ "page_view_count": {
+ "name": "page_view_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
- "refine_count": {
- "name": "refine_count",
- "type": "integer",
+ "config": {
+ "name": "config",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "new_count": {
- "name": "new_count",
- "type": "integer",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "started_at": {
- "name": "started_at",
- "type": "timestamp with time zone",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "now()"
- },
- "completed_at": {
- "name": "completed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
+ "default": "'private'"
},
"accessed_at": {
"name": "accessed_at",
@@ -17971,81 +22929,26 @@
}
},
"indexes": {
- "expertise_runs_domain_run_index_unique": {
- "name": "expertise_runs_domain_run_index_unique",
- "columns": [
- {
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "run_index",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "expertise_runs_domain_reflection_key_unique": {
- "name": "expertise_runs_domain_reflection_key_unique",
+ "file_shares_file_id_unique": {
+ "name": "file_shares_file_id_unique",
"columns": [
{
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "reflection_key",
+ "expression": "file_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"expertise_runs\".\"reflection_key\" is not null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "expertise_runs_domain_started_idx": {
- "name": "expertise_runs_domain_started_idx",
- "columns": [
- {
- "expression": "domain_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "started_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "expertise_runs_actor_idx": {
- "name": "expertise_runs_actor_idx",
+ "file_shares_user_id_idx": {
+ "name": "file_shares_user_id_idx",
"columns": [
{
- "expression": "actor_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "actor_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -18056,17 +22959,11 @@
"method": "btree",
"with": {}
},
- "expertise_runs_subject_idx": {
- "name": "expertise_runs_subject_idx",
+ "file_shares_workspace_id_idx": {
+ "name": "file_shares_workspace_id_idx",
"columns": [
{
- "expression": "subject_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "subject_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -18079,27 +22976,27 @@
}
},
"foreignKeys": {
- "expertise_runs_domain_id_expertise_domains_id_fk": {
- "name": "expertise_runs_domain_id_expertise_domains_id_fk",
- "tableFrom": "expertise_runs",
- "tableTo": "expertise_domains",
- "columnsFrom": ["domain_id"],
+ "file_shares_file_id_files_id_fk": {
+ "name": "file_shares_file_id_files_id_fk",
+ "tableFrom": "file_shares",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_runs_user_id_users_id_fk": {
- "name": "expertise_runs_user_id_users_id_fk",
- "tableFrom": "expertise_runs",
+ "file_shares_user_id_users_id_fk": {
+ "name": "file_shares_user_id_users_id_fk",
+ "tableFrom": "file_shares",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "expertise_runs_workspace_id_workspaces_id_fk": {
- "name": "expertise_runs_workspace_id_workspaces_id_fk",
- "tableFrom": "expertise_runs",
+ "file_shares_workspace_id_workspaces_id_fk": {
+ "name": "file_shares_workspace_id_workspaces_id_fk",
+ "tableFrom": "file_shares",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
@@ -18108,90 +23005,111 @@
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "expertise_runs_id_domain_unique": {
- "name": "expertise_runs_id_domain_unique",
- "nullsNotDistinct": false,
- "columns": ["id", "domain_id"]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.user_favorites": {
- "name": "user_favorites",
+ "public.fts_search_sync_capture_version": {
+ "name": "fts_search_sync_capture_version",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "version": {
+ "name": "version",
+ "type": "integer",
"primaryKey": false,
"notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.fts_search_sync_outbox": {
+ "name": "fts_search_sync_outbox",
+ "schema": "",
+ "columns": {
+ "attempts": {
+ "name": "attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "available_at": {
+ "name": "available_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
- "type": {
- "name": "type",
- "type": "text",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
- "target_id": {
- "name": "target_id",
- "type": "text",
+ "dead_at": {
+ "name": "dead_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "path": {
- "name": "path",
+ "document_id": {
+ "name": "document_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "title": {
- "name": "title",
+ "entity": {
+ "name": "entity",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "icon": {
- "name": "icon",
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "last_error": {
+ "name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "sort_order": {
- "name": "sort_order",
- "type": "integer",
+ "locked_until": {
+ "name": "locked_until",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": false
},
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
+ "priority": {
+ "name": "priority",
+ "type": "smallint",
"primaryKey": false,
"notNull": true,
- "default": "now()"
+ "default": 10
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
+ "revision": {
+ "name": "revision",
+ "type": "bigint",
"primaryKey": false,
"notNull": true,
- "default": "now()"
+ "default": "nextval('fts_search_sync_revision_seq')"
},
"updated_at": {
"name": "updated_at",
@@ -18202,256 +23120,165 @@
}
},
"indexes": {
- "user_favorites_personal_target_unique": {
- "name": "user_favorites_personal_target_unique",
+ "fts_search_sync_outbox_entity_document_id_unique": {
+ "name": "fts_search_sync_outbox_entity_document_id_unique",
"columns": [
{
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "type",
+ "expression": "entity",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "target_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"user_favorites\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_favorites_workspace_target_unique": {
- "name": "user_favorites_workspace_target_unique",
+ "fts_search_sync_outbox_claim_idx": {
+ "name": "fts_search_sync_outbox_claim_idx",
"columns": [
{
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "workspace_id",
+ "expression": "priority",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "type",
+ "expression": "available_at",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "target_id",
+ "expression": "revision",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"user_favorites\".\"workspace_id\" IS NOT NULL",
+ "isUnique": false,
+ "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_favorites_user_id_idx": {
- "name": "user_favorites_user_id_idx",
+ "fts_search_sync_outbox_dead_idx": {
+ "name": "fts_search_sync_outbox_dead_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "dead_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "user_favorites_workspace_id_idx": {
- "name": "user_favorites_workspace_id_idx",
+ "fts_search_sync_outbox_lease_idx": {
+ "name": "fts_search_sync_outbox_lease_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "locked_until",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NULL AND \"fts_search_sync_outbox\".\"locked_until\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
- "foreignKeys": {
- "user_favorites_user_id_users_id_fk": {
- "name": "user_favorites_user_id_users_id_fk",
- "tableFrom": "user_favorites",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "user_favorites_workspace_id_workspaces_id_fk": {
- "name": "user_favorites_workspace_id_workspaces_id_fk",
- "tableFrom": "user_favorites",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
+ "foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.documents": {
- "name": "documents",
+ "public.generation_batches": {
+ "name": "generation_batches",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "varchar(255)",
+ "type": "text",
"primaryKey": true,
"notNull": true
},
- "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
},
- "content": {
- "name": "content",
+ "generation_topic_id": {
+ "name": "generation_topic_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "file_type": {
- "name": "file_type",
- "type": "varchar(255)",
- "primaryKey": false,
"notNull": true
},
- "filename": {
- "name": "filename",
+ "provider": {
+ "name": "provider",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "total_char_count": {
- "name": "total_char_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- },
- "total_line_count": {
- "name": "total_line_count",
- "type": "integer",
- "primaryKey": false,
"notNull": true
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "pages": {
- "name": "pages",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "source_type": {
- "name": "source_type",
+ "model": {
+ "name": "model",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "source": {
- "name": "source",
+ "prompt": {
+ "name": "prompt",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "file_id": {
- "name": "file_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "knowledge_base_id": {
- "name": "knowledge_base_id",
- "type": "text",
+ "width": {
+ "name": "width",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "parent_id": {
- "name": "parent_id",
- "type": "varchar(255)",
+ "height": {
+ "name": "height",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "client_id": {
- "name": "client_id",
- "type": "text",
+ "ratio": {
+ "name": "ratio",
+ "type": "varchar(64)",
"primaryKey": false,
"notNull": false
},
- "editor_data": {
- "name": "editor_data",
+ "config": {
+ "name": "config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "slug": {
- "name": "slug",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "visibility": {
- "name": "visibility",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'public'"
- },
"deleted_at": {
"name": "deleted_at",
"type": "timestamp with time zone",
@@ -18487,53 +23314,8 @@
}
},
"indexes": {
- "documents_source_idx": {
- "name": "documents_source_idx",
- "columns": [
- {
- "expression": "source",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_file_type_idx": {
- "name": "documents_file_type_idx",
- "columns": [
- {
- "expression": "file_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_source_type_idx": {
- "name": "documents_source_type_idx",
- "columns": [
- {
- "expression": "source_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_user_id_idx": {
- "name": "documents_user_id_idx",
+ "generation_batches_user_id_idx": {
+ "name": "generation_batches_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -18547,99 +23329,11 @@
"method": "btree",
"with": {}
},
- "documents_file_id_idx": {
- "name": "documents_file_id_idx",
- "columns": [
- {
- "expression": "file_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_parent_id_idx": {
- "name": "documents_parent_id_idx",
- "columns": [
- {
- "expression": "parent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_knowledge_base_id_idx": {
- "name": "documents_knowledge_base_id_idx",
- "columns": [
- {
- "expression": "knowledge_base_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_client_id_user_id_unique": {
- "name": "documents_client_id_user_id_unique",
- "columns": [
- {
- "expression": "client_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_slug_user_id_unique": {
- "name": "documents_slug_user_id_unique",
- "columns": [
- {
- "expression": "slug",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"documents\".\"workspace_id\" IS NULL AND \"documents\".\"slug\" IS NOT NULL",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "documents_workspace_id_idx": {
- "name": "documents_workspace_id_idx",
+ "generation_batches_topic_id_idx": {
+ "name": "generation_batches_topic_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "generation_topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -18650,101 +23344,49 @@
"method": "btree",
"with": {}
},
- "documents_workspace_visibility_idx": {
- "name": "documents_workspace_visibility_idx",
+ "generation_batches_workspace_id_idx": {
+ "name": "generation_batches_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
- },
- "documents_slug_workspace_id_unique": {
- "name": "documents_slug_workspace_id_unique",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "slug",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"documents\".\"workspace_id\" is not null",
- "concurrently": false,
- "method": "btree",
- "with": {}
}
},
"foreignKeys": {
- "documents_file_id_files_id_fk": {
- "name": "documents_file_id_files_id_fk",
- "tableFrom": "documents",
- "tableTo": "files",
- "columnsFrom": ["file_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "documents_knowledge_base_id_knowledge_bases_id_fk": {
- "name": "documents_knowledge_base_id_knowledge_bases_id_fk",
- "tableFrom": "documents",
- "tableTo": "knowledge_bases",
- "columnsFrom": ["knowledge_base_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "documents_parent_id_documents_id_fk": {
- "name": "documents_parent_id_documents_id_fk",
- "tableFrom": "documents",
- "tableTo": "documents",
- "columnsFrom": ["parent_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "documents_user_id_users_id_fk": {
- "name": "documents_user_id_users_id_fk",
- "tableFrom": "documents",
+ "generation_batches_user_id_users_id_fk": {
+ "name": "generation_batches_user_id_users_id_fk",
+ "tableFrom": "generation_batches",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "documents_workspace_id_workspaces_id_fk": {
- "name": "documents_workspace_id_workspaces_id_fk",
- "tableFrom": "documents",
+ "generation_batches_workspace_id_workspaces_id_fk": {
+ "name": "generation_batches_workspace_id_workspaces_id_fk",
+ "tableFrom": "generation_batches",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "generation_batches_generation_topic_id_generation_topics_id_fk": {
+ "name": "generation_batches_generation_topic_id_generation_topics_id_fk",
+ "tableFrom": "generation_batches",
+ "tableTo": "generation_topics",
+ "columnsFrom": ["generation_topic_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -18753,16 +23395,15 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.file_uploads": {
- "name": "file_uploads",
+ "public.generation_topics": {
+ "name": "generation_topics",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
"user_id": {
"name": "user_id",
@@ -18776,54 +23417,50 @@
"primaryKey": false,
"notNull": false
},
- "pathname": {
- "name": "pathname",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "size": {
- "name": "size",
- "type": "integer",
+ "cover_url": {
+ "name": "cover_url",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "status": {
- "name": "status",
- "type": "text",
+ "type": {
+ "name": "type",
+ "type": "varchar(32)",
"primaryKey": false,
"notNull": true,
- "default": "'active'"
+ "default": "'image'"
},
- "multipart_upload_id": {
- "name": "multipart_upload_id",
+ "visibility": {
+ "name": "visibility",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "multipart_part_size": {
- "name": "multipart_part_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'public'"
},
- "completed_at": {
- "name": "completed_at",
+ "deleted_at": {
+ "name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "file_id": {
- "name": "file_id",
- "type": "text",
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
"primaryKey": false,
"notNull": false
},
- "expires_at": {
- "name": "expires_at",
+ "accessed_at": {
+ "name": "accessed_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -18841,65 +23478,26 @@
}
},
"indexes": {
- "file_uploads_user_scope_status_idx": {
- "name": "file_uploads_user_scope_status_idx",
+ "generation_topics_user_id_idx": {
+ "name": "generation_topics_user_id_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
- "with": {}
- },
- "file_uploads_workspace_status_idx": {
- "name": "file_uploads_workspace_status_idx",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "file_uploads_status_expires_at_idx": {
- "name": "file_uploads_status_expires_at_idx",
- "columns": [
- {
- "expression": "status",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
+ "with": {}
+ },
+ "generation_topics_workspace_id_idx": {
+ "name": "generation_topics_workspace_id_idx",
+ "columns": [
{
- "expression": "expires_at",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -18910,23 +23508,23 @@
"method": "btree",
"with": {}
},
- "file_uploads_status_updated_at_id_idx": {
- "name": "file_uploads_status_updated_at_id_idx",
+ "generation_topics_workspace_visibility_idx": {
+ "name": "generation_topics_workspace_visibility_idx",
"columns": [
{
- "expression": "status",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "updated_at",
+ "expression": "visibility",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -18936,51 +23534,26 @@
"concurrently": false,
"method": "btree",
"with": {}
- },
- "file_uploads_live_pathname_unique": {
- "name": "file_uploads_live_pathname_unique",
- "columns": [
- {
- "expression": "pathname",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"file_uploads\".\"status\" IN ('active', 'cleaning')",
- "concurrently": false,
- "method": "btree",
- "with": {}
}
},
"foreignKeys": {
- "file_uploads_user_id_users_id_fk": {
- "name": "file_uploads_user_id_users_id_fk",
- "tableFrom": "file_uploads",
+ "generation_topics_user_id_users_id_fk": {
+ "name": "generation_topics_user_id_users_id_fk",
+ "tableFrom": "generation_topics",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "file_uploads_workspace_id_workspaces_id_fk": {
- "name": "file_uploads_workspace_id_workspaces_id_fk",
- "tableFrom": "file_uploads",
+ "generation_topics_workspace_id_workspaces_id_fk": {
+ "name": "generation_topics_workspace_id_workspaces_id_fk",
+ "tableFrom": "generation_topics",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
- },
- "file_uploads_file_id_files_id_fk": {
- "name": "file_uploads_file_id_files_id_fk",
- "tableFrom": "file_uploads",
- "tableTo": "files",
- "columnsFrom": ["file_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -18989,8 +23562,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.files": {
- "name": "files",
+ "public.generations": {
+ "name": "generations",
"schema": "",
"columns": {
"id": {
@@ -19005,85 +23578,42 @@
"primaryKey": false,
"notNull": true
},
- "file_type": {
- "name": "file_type",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "file_hash": {
- "name": "file_hash",
- "type": "varchar(64)",
- "primaryKey": false,
- "notNull": false
- },
- "name": {
- "name": "name",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
- },
- "size": {
- "name": "size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "url": {
- "name": "url",
- "type": "text",
+ "generation_batch_id": {
+ "name": "generation_batch_id",
+ "type": "varchar(64)",
"primaryKey": false,
"notNull": true
},
- "source": {
- "name": "source",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "parent_id": {
- "name": "parent_id",
- "type": "varchar(255)",
+ "async_task_id": {
+ "name": "async_task_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "client_id": {
- "name": "client_id",
+ "file_id": {
+ "name": "file_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "chunk_task_id": {
- "name": "chunk_task_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "embedding_task_id": {
- "name": "embedding_task_id",
- "type": "uuid",
+ "seed": {
+ "name": "seed",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "asset": {
+ "name": "asset",
+ "type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'public'"
- },
"deleted_at": {
"name": "deleted_at",
"type": "timestamp with time zone",
@@ -19119,23 +23649,8 @@
}
},
"indexes": {
- "file_hash_idx": {
- "name": "file_hash_idx",
- "columns": [
- {
- "expression": "file_hash",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "files_user_id_idx": {
- "name": "files_user_id_idx",
+ "generations_user_id_idx": {
+ "name": "generations_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -19149,41 +23664,11 @@
"method": "btree",
"with": {}
},
- "files_parent_id_idx": {
- "name": "files_parent_id_idx",
- "columns": [
- {
- "expression": "parent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "files_chunk_task_id_idx": {
- "name": "files_chunk_task_id_idx",
- "columns": [
- {
- "expression": "chunk_task_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "files_embedding_task_id_idx": {
- "name": "files_embedding_task_id_idx",
+ "generations_batch_id_idx": {
+ "name": "generations_batch_id_idx",
"columns": [
{
- "expression": "embedding_task_id",
+ "expression": "generation_batch_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19194,32 +23679,11 @@
"method": "btree",
"with": {}
},
- "files_client_id_user_id_unique": {
- "name": "files_client_id_user_id_unique",
- "columns": [
- {
- "expression": "client_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "files_workspace_id_idx": {
- "name": "files_workspace_id_idx",
+ "generations_file_id_idx": {
+ "name": "generations_file_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "file_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19230,26 +23694,14 @@
"method": "btree",
"with": {}
},
- "files_workspace_visibility_idx": {
- "name": "files_workspace_visibility_idx",
+ "generations_workspace_id_idx": {
+ "name": "generations_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
}
],
"isUnique": false,
@@ -19259,56 +23711,47 @@
}
},
"foreignKeys": {
- "files_user_id_users_id_fk": {
- "name": "files_user_id_users_id_fk",
- "tableFrom": "files",
+ "generations_user_id_users_id_fk": {
+ "name": "generations_user_id_users_id_fk",
+ "tableFrom": "generations",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "files_file_hash_global_files_hash_id_fk": {
- "name": "files_file_hash_global_files_hash_id_fk",
- "tableFrom": "files",
- "tableTo": "global_files",
- "columnsFrom": ["file_hash"],
- "columnsTo": ["hash_id"],
- "onDelete": "no action",
- "onUpdate": "no action"
- },
- "files_parent_id_documents_id_fk": {
- "name": "files_parent_id_documents_id_fk",
- "tableFrom": "files",
- "tableTo": "documents",
- "columnsFrom": ["parent_id"],
+ "generations_workspace_id_workspaces_id_fk": {
+ "name": "generations_workspace_id_workspaces_id_fk",
+ "tableFrom": "generations",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "files_chunk_task_id_async_tasks_id_fk": {
- "name": "files_chunk_task_id_async_tasks_id_fk",
- "tableFrom": "files",
- "tableTo": "async_tasks",
- "columnsFrom": ["chunk_task_id"],
+ "generations_generation_batch_id_generation_batches_id_fk": {
+ "name": "generations_generation_batch_id_generation_batches_id_fk",
+ "tableFrom": "generations",
+ "tableTo": "generation_batches",
+ "columnsFrom": ["generation_batch_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "files_embedding_task_id_async_tasks_id_fk": {
- "name": "files_embedding_task_id_async_tasks_id_fk",
- "tableFrom": "files",
+ "generations_async_task_id_async_tasks_id_fk": {
+ "name": "generations_async_task_id_async_tasks_id_fk",
+ "tableFrom": "generations",
"tableTo": "async_tasks",
- "columnsFrom": ["embedding_task_id"],
+ "columnsFrom": ["async_task_id"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "files_workspace_id_workspaces_id_fk": {
- "name": "files_workspace_id_workspaces_id_fk",
- "tableFrom": "files",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "generations_file_id_files_id_fk": {
+ "name": "generations_file_id_files_id_fk",
+ "tableFrom": "generations",
+ "tableTo": "files",
+ "columnsFrom": ["file_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -19320,45 +23763,125 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.global_files": {
- "name": "global_files",
+ "public.goals": {
+ "name": "goals",
"schema": "",
"columns": {
- "hash_id": {
- "name": "hash_id",
- "type": "varchar(64)",
+ "id": {
+ "name": "id",
+ "type": "text",
"primaryKey": true,
"notNull": true
},
- "file_type": {
- "name": "file_type",
- "type": "varchar(255)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "size": {
- "name": "size",
- "type": "integer",
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "url": {
- "name": "url",
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "metadata": {
- "name": "metadata",
+ "requirement": {
+ "name": "requirement",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "config": {
+ "name": "config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "creator": {
- "name": "creator",
+ "max_rounds": {
+ "name": "max_rounds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "max_total_cost": {
+ "name": "max_total_cost",
+ "type": "numeric(20, 6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'planning'"
+ },
+ "subject_type": {
+ "name": "subject_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "subject_id": {
+ "name": "subject_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
+ "primaryKey": false,
+ "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
},
"created_at": {
"name": "created_at",
@@ -19367,8 +23890,8 @@
"notNull": true,
"default": "now()"
},
- "accessed_at": {
- "name": "accessed_at",
+ "updated_at": {
+ "name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
@@ -19376,11 +23899,11 @@
}
},
"indexes": {
- "global_files_creator_idx": {
- "name": "global_files_creator_idx",
+ "goals_user_id_idx": {
+ "name": "goals_user_id_idx",
"columns": [
{
- "expression": "creator",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19390,67 +23913,54 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "global_files_creator_users_id_fk": {
- "name": "global_files_creator_users_id_fk",
- "tableFrom": "global_files",
- "tableTo": "users",
- "columnsFrom": ["creator"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.knowledge_base_files": {
- "name": "knowledge_base_files",
- "schema": "",
- "columns": {
- "knowledge_base_id": {
- "name": "knowledge_base_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "file_id": {
- "name": "file_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
+ "goals_workspace_id_idx": {
+ "name": "goals_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "knowledge_base_files_kb_id_idx": {
- "name": "knowledge_base_files_kb_id_idx",
+ "goals_workspace_visibility_idx": {
+ "name": "goals_workspace_visibility_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "goals_agent_id_idx": {
+ "name": "goals_agent_id_idx",
"columns": [
{
- "expression": "knowledge_base_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19461,11 +23971,11 @@
"method": "btree",
"with": {}
},
- "knowledge_base_files_user_id_idx": {
- "name": "knowledge_base_files_user_id_idx",
+ "goals_project_id_idx": {
+ "name": "goals_project_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19476,11 +23986,11 @@
"method": "btree",
"with": {}
},
- "knowledge_base_files_file_id_idx": {
- "name": "knowledge_base_files_file_id_idx",
+ "goals_status_idx": {
+ "name": "goals_status_idx",
"columns": [
{
- "expression": "file_id",
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19491,11 +24001,17 @@
"method": "btree",
"with": {}
},
- "knowledge_base_files_workspace_id_idx": {
- "name": "knowledge_base_files_workspace_id_idx",
+ "goals_subject_idx": {
+ "name": "goals_subject_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "subject_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "subject_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19508,144 +24024,83 @@
}
},
"foreignKeys": {
- "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk": {
- "name": "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk",
- "tableFrom": "knowledge_base_files",
- "tableTo": "knowledge_bases",
- "columnsFrom": ["knowledge_base_id"],
+ "goals_user_id_users_id_fk": {
+ "name": "goals_user_id_users_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "knowledge_base_files_file_id_files_id_fk": {
- "name": "knowledge_base_files_file_id_files_id_fk",
- "tableFrom": "knowledge_base_files",
- "tableTo": "files",
- "columnsFrom": ["file_id"],
+ "goals_workspace_id_workspaces_id_fk": {
+ "name": "goals_workspace_id_workspaces_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "knowledge_base_files_user_id_users_id_fk": {
- "name": "knowledge_base_files_user_id_users_id_fk",
- "tableFrom": "knowledge_base_files",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "goals_agent_id_agents_id_fk": {
+ "name": "goals_agent_id_agents_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "knowledge_base_files_workspace_id_workspaces_id_fk": {
- "name": "knowledge_base_files_workspace_id_workspaces_id_fk",
- "tableFrom": "knowledge_base_files",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "goals_project_id_projects_id_fk": {
+ "name": "goals_project_id_projects_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
- "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"]
- }
- },
+ "compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.knowledge_bases": {
- "name": "knowledge_bases",
+ "public.goal_edges": {
+ "name": "goal_edges",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "name": {
- "name": "name",
+ "goal_id": {
+ "name": "goal_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "avatar": {
- "name": "avatar",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "type": {
- "name": "type",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "source_node_id": {
+ "name": "source_node_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "client_id": {
- "name": "client_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "is_public": {
- "name": "is_public",
- "type": "boolean",
- "primaryKey": false,
- "notNull": false,
- "default": false
- },
- "settings": {
- "name": "settings",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
+ "target_node_id": {
+ "name": "target_node_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "visibility": {
- "name": "visibility",
+ "kind": {
+ "name": "kind",
"type": "text",
"primaryKey": false,
- "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",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": true
},
"created_at": {
"name": "created_at",
@@ -19653,57 +24108,41 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "knowledge_bases_client_id_user_id_unique": {
- "name": "knowledge_bases_client_id_user_id_unique",
+ "goal_edges_source_target_kind_unique": {
+ "name": "goal_edges_source_target_kind_unique",
"columns": [
{
- "expression": "client_id",
+ "expression": "source_node_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "target_node_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": true,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "knowledge_bases_user_id_idx": {
- "name": "knowledge_bases_user_id_idx",
- "columns": [
+ },
{
- "expression": "user_id",
+ "expression": "kind",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "knowledge_bases_workspace_id_idx": {
- "name": "knowledge_bases_workspace_id_idx",
+ "goal_edges_goal_id_idx": {
+ "name": "goal_edges_goal_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "goal_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19714,23 +24153,11 @@
"method": "btree",
"with": {}
},
- "knowledge_bases_workspace_visibility_idx": {
- "name": "knowledge_bases_workspace_visibility_idx",
+ "goal_edges_target_node_id_idx": {
+ "name": "goal_edges_target_node_id_idx",
"columns": [
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
+ "expression": "target_node_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19743,21 +24170,30 @@
}
},
"foreignKeys": {
- "knowledge_bases_user_id_users_id_fk": {
- "name": "knowledge_bases_user_id_users_id_fk",
- "tableFrom": "knowledge_bases",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "goal_edges_goal_id_goals_id_fk": {
+ "name": "goal_edges_goal_id_goals_id_fk",
+ "tableFrom": "goal_edges",
+ "tableTo": "goals",
+ "columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "knowledge_bases_workspace_id_workspaces_id_fk": {
- "name": "knowledge_bases_workspace_id_workspaces_id_fk",
- "tableFrom": "knowledge_bases",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
+ "goal_edges_goal_source_node_fk": {
+ "name": "goal_edges_goal_source_node_fk",
+ "tableFrom": "goal_edges",
+ "tableTo": "goal_nodes",
+ "columnsFrom": ["goal_id", "source_node_id"],
+ "columnsTo": ["goal_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "goal_edges_goal_target_node_fk": {
+ "name": "goal_edges_goal_target_node_fk",
+ "tableFrom": "goal_edges",
+ "tableTo": "goal_nodes",
+ "columnsFrom": ["goal_id", "target_node_id"],
+ "columnsTo": ["goal_id", "id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19765,69 +24201,78 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "goal_edges_distinct_nodes": {
+ "name": "goal_edges_distinct_nodes",
+ "value": "\"goal_edges\".\"source_node_id\" <> \"goal_edges\".\"target_node_id\""
+ }
+ },
"isRLSEnabled": false
},
- "public.file_shares": {
- "name": "file_shares",
+ "public.goal_events": {
+ "name": "goal_events",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "goal_id": {
+ "name": "goal_id",
+ "type": "text",
+ "primaryKey": false,
"notNull": true
},
- "file_id": {
- "name": "file_id",
+ "event_type": {
+ "name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "entity_type": {
+ "name": "entity_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "entity_id": {
+ "name": "entity_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "page_view_count": {
- "name": "page_view_count",
- "type": "integer",
+ "actor_type": {
+ "name": "actor_type",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": true
},
- "config": {
- "name": "config",
- "type": "jsonb",
+ "actor_id": {
+ "name": "actor_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
+ "operation_id": {
+ "name": "operation_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'private'"
+ "notNull": false
},
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
+ "reason": {
+ "name": "reason",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -19835,36 +24280,41 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "file_shares_file_id_unique": {
- "name": "file_shares_file_id_unique",
+ "goal_events_goal_id_created_at_idx": {
+ "name": "goal_events_goal_id_created_at_idx",
"columns": [
{
- "expression": "file_id",
+ "expression": "goal_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "file_shares_user_id_idx": {
- "name": "file_shares_user_id_idx",
+ "goal_events_entity_idx": {
+ "name": "goal_events_entity_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "entity_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "entity_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19875,11 +24325,26 @@
"method": "btree",
"with": {}
},
- "file_shares_workspace_id_idx": {
- "name": "file_shares_workspace_id_idx",
+ "goal_events_task_id_idx": {
+ "name": "goal_events_task_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "goal_events_operation_id_idx": {
+ "name": "goal_events_operation_id_idx",
+ "columns": [
+ {
+ "expression": "operation_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -19892,31 +24357,22 @@
}
},
"foreignKeys": {
- "file_shares_file_id_files_id_fk": {
- "name": "file_shares_file_id_files_id_fk",
- "tableFrom": "file_shares",
- "tableTo": "files",
- "columnsFrom": ["file_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "file_shares_user_id_users_id_fk": {
- "name": "file_shares_user_id_users_id_fk",
- "tableFrom": "file_shares",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "goal_events_goal_id_goals_id_fk": {
+ "name": "goal_events_goal_id_goals_id_fk",
+ "tableFrom": "goal_events",
+ "tableTo": "goals",
+ "columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "file_shares_workspace_id_workspaces_id_fk": {
- "name": "file_shares_workspace_id_workspaces_id_fk",
- "tableFrom": "file_shares",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "goal_events_task_id_tasks_id_fk": {
+ "name": "goal_events_task_id_tasks_id_fk",
+ "tableFrom": "goal_events",
+ "tableTo": "tasks",
+ "columnsFrom": ["task_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
@@ -19926,106 +24382,115 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.fts_search_sync_capture_version": {
- "name": "fts_search_sync_capture_version",
+ "public.goal_node_decisions": {
+ "name": "goal_node_decisions",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "node_id": {
+ "name": "node_id",
+ "type": "uuid",
+ "primaryKey": false,
"notNull": true
},
- "version": {
- "name": "version",
- "type": "integer",
+ "authority": {
+ "name": "authority",
+ "type": "text",
"primaryKey": false,
"notNull": true
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.fts_search_sync_outbox": {
- "name": "fts_search_sync_outbox",
- "schema": "",
- "columns": {
- "attempts": {
- "name": "attempts",
- "type": "integer",
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": 0
+ "default": "'pending'"
},
- "available_at": {
- "name": "available_at",
- "type": "timestamp with time zone",
+ "question": {
+ "name": "question",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": true
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
+ "options": {
+ "name": "options",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "dead_at": {
- "name": "dead_at",
- "type": "timestamp with time zone",
+ "recommended_option_id": {
+ "name": "recommended_option_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "document_id": {
- "name": "document_id",
+ "requested_user_id": {
+ "name": "requested_user_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "entity": {
- "name": "entity",
+ "requested_project_role": {
+ "name": "requested_project_role",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "resolved_option_id": {
+ "name": "resolved_option_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolution": {
+ "name": "resolution",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_by_user_id": {
+ "name": "resolved_by_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
},
- "last_error": {
- "name": "last_error",
+ "resolved_by_agent_id": {
+ "name": "resolved_by_agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "locked_until": {
- "name": "locked_until",
+ "resolved_at": {
+ "name": "resolved_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "priority": {
- "name": "priority",
- "type": "smallint",
+ "canceled_at": {
+ "name": "canceled_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
- "default": 10
+ "default": "now()"
},
- "revision": {
- "name": "revision",
- "type": "bigint",
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
- "default": "nextval('fts_search_sync_revision_seq')"
+ "default": "now()"
},
"updated_at": {
"name": "updated_at",
@@ -20036,17 +24501,11 @@
}
},
"indexes": {
- "fts_search_sync_outbox_entity_document_id_unique": {
- "name": "fts_search_sync_outbox_entity_document_id_unique",
+ "goal_node_decisions_node_id_unique": {
+ "name": "goal_node_decisions_node_id_unique",
"columns": [
{
- "expression": "entity",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "document_id",
+ "expression": "node_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20057,214 +24516,172 @@
"method": "btree",
"with": {}
},
- "fts_search_sync_outbox_claim_idx": {
- "name": "fts_search_sync_outbox_claim_idx",
+ "goal_node_decisions_status_idx": {
+ "name": "goal_node_decisions_status_idx",
"columns": [
{
- "expression": "priority",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "available_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "revision",
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "fts_search_sync_outbox_dead_idx": {
- "name": "fts_search_sync_outbox_dead_idx",
+ "goal_node_decisions_resolved_by_user_id_idx": {
+ "name": "goal_node_decisions_resolved_by_user_id_idx",
"columns": [
{
- "expression": "dead_at",
+ "expression": "resolved_by_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "fts_search_sync_outbox_lease_idx": {
- "name": "fts_search_sync_outbox_lease_idx",
+ "goal_node_decisions_requested_user_id_status_idx": {
+ "name": "goal_node_decisions_requested_user_id_status_idx",
"columns": [
{
- "expression": "locked_until",
+ "expression": "requested_user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"fts_search_sync_outbox\".\"dead_at\" IS NULL AND \"fts_search_sync_outbox\".\"locked_until\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
- "foreignKeys": {},
+ "foreignKeys": {
+ "goal_node_decisions_node_id_goal_nodes_id_fk": {
+ "name": "goal_node_decisions_node_id_goal_nodes_id_fk",
+ "tableFrom": "goal_node_decisions",
+ "tableTo": "goal_nodes",
+ "columnsFrom": ["node_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "goal_node_decisions_requested_user_id_users_id_fk": {
+ "name": "goal_node_decisions_requested_user_id_users_id_fk",
+ "tableFrom": "goal_node_decisions",
+ "tableTo": "users",
+ "columnsFrom": ["requested_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "goal_node_decisions_resolved_by_user_id_users_id_fk": {
+ "name": "goal_node_decisions_resolved_by_user_id_users_id_fk",
+ "tableFrom": "goal_node_decisions",
+ "tableTo": "users",
+ "columnsFrom": ["resolved_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "goal_node_decisions_resolved_by_agent_id_agents_id_fk": {
+ "name": "goal_node_decisions_resolved_by_agent_id_agents_id_fk",
+ "tableFrom": "goal_node_decisions",
+ "tableTo": "agents",
+ "columnsFrom": ["resolved_by_agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.generation_batches": {
- "name": "generation_batches",
+ "public.goal_node_work_versions": {
+ "name": "goal_node_work_versions",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "generation_topic_id": {
- "name": "generation_topic_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "provider": {
- "name": "provider",
- "type": "text",
+ "node_id": {
+ "name": "node_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "model": {
- "name": "model",
- "type": "text",
+ "work_version_id": {
+ "name": "work_version_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "prompt": {
- "name": "prompt",
+ "relation": {
+ "name": "relation",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "width": {
- "name": "width",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "height": {
- "name": "height",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "ratio": {
- "name": "ratio",
- "type": "varchar(64)",
- "primaryKey": false,
- "notNull": false
- },
- "config": {
- "name": "config",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "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",
- "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": {
- "generation_batches_user_id_idx": {
- "name": "generation_batches_user_id_idx",
+ "goal_node_work_versions_node_version_relation_unique": {
+ "name": "goal_node_work_versions_node_version_relation_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "node_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "generation_batches_topic_id_idx": {
- "name": "generation_batches_topic_id_idx",
- "columns": [
+ },
{
- "expression": "generation_topic_id",
+ "expression": "work_version_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "relation",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "generation_batches_workspace_id_idx": {
- "name": "generation_batches_workspace_id_idx",
+ "goal_node_work_versions_work_version_id_idx": {
+ "name": "goal_node_work_versions_work_version_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "work_version_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20277,29 +24694,20 @@
}
},
"foreignKeys": {
- "generation_batches_user_id_users_id_fk": {
- "name": "generation_batches_user_id_users_id_fk",
- "tableFrom": "generation_batches",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "generation_batches_workspace_id_workspaces_id_fk": {
- "name": "generation_batches_workspace_id_workspaces_id_fk",
- "tableFrom": "generation_batches",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "goal_node_work_versions_node_id_goal_nodes_id_fk": {
+ "name": "goal_node_work_versions_node_id_goal_nodes_id_fk",
+ "tableFrom": "goal_node_work_versions",
+ "tableTo": "goal_nodes",
+ "columnsFrom": ["node_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "generation_batches_generation_topic_id_generation_topics_id_fk": {
- "name": "generation_batches_generation_topic_id_generation_topics_id_fk",
- "tableFrom": "generation_batches",
- "tableTo": "generation_topics",
- "columnsFrom": ["generation_topic_id"],
+ "goal_node_work_versions_work_version_id_work_versions_id_fk": {
+ "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"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -20311,63 +24719,82 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.generation_topics": {
- "name": "generation_topics",
+ "public.goal_nodes": {
+ "name": "goal_nodes",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "goal_id": {
+ "name": "goal_id",
+ "type": "text",
+ "primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "kind": {
+ "name": "kind",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'proposed'"
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
"notNull": false
},
- "cover_url": {
- "name": "cover_url",
+ "task_id": {
+ "name": "task_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "type": {
- "name": "type",
- "type": "varchar(32)",
+ "priority": {
+ "name": "priority",
+ "type": "integer",
"primaryKey": false,
"notNull": true,
- "default": "'image'"
+ "default": 0
},
- "visibility": {
- "name": "visibility",
+ "confidence": {
+ "name": "confidence",
+ "type": "numeric(4, 3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_user_id": {
+ "name": "created_by_user_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'public'"
+ "notNull": false
},
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
+ "created_by_agent_id": {
+ "name": "created_by_agent_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "is_deleted": {
- "name": "is_deleted",
- "type": "boolean",
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
@@ -20394,11 +24821,17 @@
}
},
"indexes": {
- "generation_topics_user_id_idx": {
- "name": "generation_topics_user_id_idx",
+ "goal_nodes_goal_id_status_idx": {
+ "name": "goal_nodes_goal_id_status_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "goal_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20409,11 +24842,11 @@
"method": "btree",
"with": {}
},
- "generation_topics_workspace_id_idx": {
- "name": "generation_topics_workspace_id_idx",
+ "goal_nodes_created_by_user_id_idx": {
+ "name": "goal_nodes_created_by_user_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "created_by_user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20424,62 +24857,101 @@
"method": "btree",
"with": {}
},
- "generation_topics_workspace_visibility_idx": {
- "name": "generation_topics_workspace_visibility_idx",
+ "goal_nodes_goal_id_kind_idx": {
+ "name": "goal_nodes_goal_id_kind_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "goal_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "visibility",
+ "expression": "kind",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "goal_nodes_task_id_unique": {
+ "name": "goal_nodes_task_id_unique",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "task_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"goal_nodes\".\"task_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "generation_topics_user_id_users_id_fk": {
- "name": "generation_topics_user_id_users_id_fk",
- "tableFrom": "generation_topics",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "goal_nodes_goal_id_goals_id_fk": {
+ "name": "goal_nodes_goal_id_goals_id_fk",
+ "tableFrom": "goal_nodes",
+ "tableTo": "goals",
+ "columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "generation_topics_workspace_id_workspaces_id_fk": {
- "name": "generation_topics_workspace_id_workspaces_id_fk",
- "tableFrom": "generation_topics",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "goal_nodes_task_id_tasks_id_fk": {
+ "name": "goal_nodes_task_id_tasks_id_fk",
+ "tableFrom": "goal_nodes",
+ "tableTo": "tasks",
+ "columnsFrom": ["task_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "goal_nodes_created_by_user_id_users_id_fk": {
+ "name": "goal_nodes_created_by_user_id_users_id_fk",
+ "tableFrom": "goal_nodes",
+ "tableTo": "users",
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "goal_nodes_created_by_agent_id_agents_id_fk": {
+ "name": "goal_nodes_created_by_agent_id_agents_id_fk",
+ "tableFrom": "goal_nodes",
+ "tableTo": "agents",
+ "columnsFrom": ["created_by_agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {},
+ "uniqueConstraints": {
+ "goal_nodes_goal_id_id_unique": {
+ "name": "goal_nodes_goal_id_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["goal_id", "id"]
+ }
+ },
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "goal_nodes_confidence_range": {
+ "name": "goal_nodes_confidence_range",
+ "value": "\"goal_nodes\".\"confidence\" IS NULL OR (\"goal_nodes\".\"confidence\" >= 0 AND \"goal_nodes\".\"confidence\" <= 1)"
+ }
+ },
"isRLSEnabled": false
},
- "public.generations": {
- "name": "generations",
+ "public.goal_shares": {
+ "name": "goal_shares",
"schema": "",
"columns": {
"id": {
@@ -20488,59 +24960,49 @@
"primaryKey": true,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "goal_id": {
+ "name": "goal_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "generation_batch_id": {
- "name": "generation_batch_id",
- "type": "varchar(64)",
- "primaryKey": false,
"notNull": true
},
- "async_task_id": {
- "name": "async_task_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "file_id": {
- "name": "file_id",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "seed": {
- "name": "seed",
+ "page_view_count": {
+ "name": "page_view_count",
"type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 0
},
- "asset": {
- "name": "asset",
+ "config": {
+ "name": "config",
"type": "jsonb",
"primaryKey": false,
"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",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'private'"
},
"accessed_at": {
"name": "accessed_at",
@@ -20565,41 +25027,26 @@
}
},
"indexes": {
- "generations_user_id_idx": {
- "name": "generations_user_id_idx",
- "columns": [
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "generations_batch_id_idx": {
- "name": "generations_batch_id_idx",
+ "goal_shares_goal_id_unique": {
+ "name": "goal_shares_goal_id_unique",
"columns": [
{
- "expression": "generation_batch_id",
+ "expression": "goal_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "generations_file_id_idx": {
- "name": "generations_file_id_idx",
+ "goal_shares_user_id_idx": {
+ "name": "goal_shares_user_id_idx",
"columns": [
{
- "expression": "file_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20610,8 +25057,8 @@
"method": "btree",
"with": {}
},
- "generations_workspace_id_idx": {
- "name": "generations_workspace_id_idx",
+ "goal_shares_workspace_id_idx": {
+ "name": "goal_shares_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -20627,47 +25074,29 @@
}
},
"foreignKeys": {
- "generations_user_id_users_id_fk": {
- "name": "generations_user_id_users_id_fk",
- "tableFrom": "generations",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "generations_workspace_id_workspaces_id_fk": {
- "name": "generations_workspace_id_workspaces_id_fk",
- "tableFrom": "generations",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "goal_shares_goal_id_goals_id_fk": {
+ "name": "goal_shares_goal_id_goals_id_fk",
+ "tableFrom": "goal_shares",
+ "tableTo": "goals",
+ "columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "generations_generation_batch_id_generation_batches_id_fk": {
- "name": "generations_generation_batch_id_generation_batches_id_fk",
- "tableFrom": "generations",
- "tableTo": "generation_batches",
- "columnsFrom": ["generation_batch_id"],
+ "goal_shares_user_id_users_id_fk": {
+ "name": "goal_shares_user_id_users_id_fk",
+ "tableFrom": "goal_shares",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "generations_async_task_id_async_tasks_id_fk": {
- "name": "generations_async_task_id_async_tasks_id_fk",
- "tableFrom": "generations",
- "tableTo": "async_tasks",
- "columnsFrom": ["async_task_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "generations_file_id_files_id_fk": {
- "name": "generations_file_id_files_id_fk",
- "tableFrom": "generations",
- "tableTo": "files",
- "columnsFrom": ["file_id"],
+ "goal_shares_workspace_id_workspaces_id_fk": {
+ "name": "goal_shares_workspace_id_workspaces_id_fk",
+ "tableFrom": "goal_shares",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -20679,125 +25108,98 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.goals": {
- "name": "goals",
+ "public.goal_subscriptions": {
+ "name": "goal_subscriptions",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "user_id": {
- "name": "user_id",
+ "goal_id": {
+ "name": "goal_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "agent_id": {
- "name": "agent_id",
- "type": "text",
+ "widget_id": {
+ "name": "widget_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "project_id": {
- "name": "project_id",
+ "metric_id": {
+ "name": "metric_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "title": {
- "name": "title",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "requirement": {
- "name": "requirement",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "config": {
- "name": "config",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "max_rounds": {
- "name": "max_rounds",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "max_total_cost": {
- "name": "max_total_cost",
- "type": "numeric(20, 6)",
- "primaryKey": false,
- "notNull": false
- },
- "status": {
- "name": "status",
- "type": "text",
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
"primaryKey": false,
"notNull": true,
- "default": "'planning'"
+ "default": false
},
- "subject_type": {
- "name": "subject_type",
- "type": "text",
+ "confirmed_version_id": {
+ "name": "confirmed_version_id",
+ "type": "uuid",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "subject_id": {
- "name": "subject_id",
- "type": "text",
+ "binding_revision": {
+ "name": "binding_revision",
+ "type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 1
},
- "started_at": {
- "name": "started_at",
- "type": "timestamp with time zone",
+ "binding": {
+ "name": "binding",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "completed_at": {
- "name": "completed_at",
- "type": "timestamp with time zone",
+ "wake_condition": {
+ "name": "wake_condition",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "archived_at": {
- "name": "archived_at",
- "type": "timestamp with time zone",
+ "freshness_policy": {
+ "name": "freshness_policy",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "visibility": {
- "name": "visibility",
- "type": "text",
+ "cursor": {
+ "name": "cursor",
+ "type": "jsonb",
"primaryKey": false,
"notNull": true,
- "default": "'public'"
+ "default": "'{}'::jsonb"
},
- "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",
@@ -20815,47 +25217,67 @@
}
},
"indexes": {
- "goals_user_id_idx": {
- "name": "goals_user_id_idx",
+ "goal_subscriptions_goal_widget_metric_unique": {
+ "name": "goal_subscriptions_goal_widget_metric_unique",
"columns": [
{
- "expression": "user_id",
+ "expression": "goal_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "widget_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "metric_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"goal_subscriptions\".\"metric_id\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goals_workspace_id_idx": {
- "name": "goals_workspace_id_idx",
+ "goal_subscriptions_goal_widget_result_unique": {
+ "name": "goal_subscriptions_goal_widget_result_unique",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "goal_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "widget_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"goal_subscriptions\".\"metric_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goals_workspace_visibility_idx": {
- "name": "goals_workspace_visibility_idx",
+ "goal_subscriptions_widget_enabled_idx": {
+ "name": "goal_subscriptions_widget_enabled_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "widget_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "visibility",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20868,66 +25290,44 @@
}
],
"isUnique": false,
+ "where": "\"goal_subscriptions\".\"enabled\" = true",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goals_agent_id_idx": {
- "name": "goals_agent_id_idx",
- "columns": [
- {
- "expression": "agent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "goals_project_id_idx": {
- "name": "goals_project_id_idx",
+ "goal_subscriptions_personal_idx": {
+ "name": "goal_subscriptions_personal_idx",
"columns": [
{
- "expression": "project_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "goals_status_idx": {
- "name": "goals_status_idx",
- "columns": [
+ },
{
- "expression": "status",
+ "expression": "goal_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"goal_subscriptions\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goals_subject_idx": {
- "name": "goals_subject_idx",
+ "goal_subscriptions_workspace_idx": {
+ "name": "goal_subscriptions_workspace_idx",
"columns": [
{
- "expression": "subject_type",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "subject_id",
+ "expression": "goal_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -20937,128 +25337,27 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "goals_user_id_users_id_fk": {
- "name": "goals_user_id_users_id_fk",
- "tableFrom": "goals",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goals_workspace_id_workspaces_id_fk": {
- "name": "goals_workspace_id_workspaces_id_fk",
- "tableFrom": "goals",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goals_agent_id_agents_id_fk": {
- "name": "goals_agent_id_agents_id_fk",
- "tableFrom": "goals",
- "tableTo": "agents",
- "columnsFrom": ["agent_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "goals_project_id_projects_id_fk": {
- "name": "goals_project_id_projects_id_fk",
- "tableFrom": "goals",
- "tableTo": "projects",
- "columnsFrom": ["project_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.goal_edges": {
- "name": "goal_edges",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "goal_id": {
- "name": "goal_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "source_node_id": {
- "name": "source_node_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "target_node_id": {
- "name": "target_node_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "kind": {
- "name": "kind",
- "type": "text",
- "primaryKey": false,
- "notNull": true
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "goal_edges_source_target_kind_unique": {
- "name": "goal_edges_source_target_kind_unique",
+ "goal_subscriptions_metric_id_idx": {
+ "name": "goal_subscriptions_metric_id_idx",
"columns": [
{
- "expression": "source_node_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "target_node_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "kind",
+ "expression": "metric_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_edges_goal_id_idx": {
- "name": "goal_edges_goal_id_idx",
+ "goal_subscriptions_confirmed_version_id_idx": {
+ "name": "goal_subscriptions_confirmed_version_id_idx",
"columns": [
{
- "expression": "goal_id",
+ "expression": "confirmed_version_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21069,47 +25368,81 @@
"method": "btree",
"with": {}
},
- "goal_edges_target_node_id_idx": {
- "name": "goal_edges_target_node_id_idx",
+ "goal_subscriptions_reconcile_idx": {
+ "name": "goal_subscriptions_reconcile_idx",
"columns": [
{
- "expression": "target_node_id",
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
+ "where": "\"goal_subscriptions\".\"enabled\" = true",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "goal_edges_goal_id_goals_id_fk": {
- "name": "goal_edges_goal_id_goals_id_fk",
- "tableFrom": "goal_edges",
+ "goal_subscriptions_goal_id_goals_id_fk": {
+ "name": "goal_subscriptions_goal_id_goals_id_fk",
+ "tableFrom": "goal_subscriptions",
"tableTo": "goals",
"columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "goal_edges_goal_source_node_fk": {
- "name": "goal_edges_goal_source_node_fk",
- "tableFrom": "goal_edges",
- "tableTo": "goal_nodes",
- "columnsFrom": ["goal_id", "source_node_id"],
- "columnsTo": ["goal_id", "id"],
+ "goal_subscriptions_widget_id_widgets_id_fk": {
+ "name": "goal_subscriptions_widget_id_widgets_id_fk",
+ "tableFrom": "goal_subscriptions",
+ "tableTo": "widgets",
+ "columnsFrom": ["widget_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "goal_edges_goal_target_node_fk": {
- "name": "goal_edges_goal_target_node_fk",
- "tableFrom": "goal_edges",
- "tableTo": "goal_nodes",
- "columnsFrom": ["goal_id", "target_node_id"],
- "columnsTo": ["goal_id", "id"],
+ "goal_subscriptions_metric_id_metrics_id_fk": {
+ "name": "goal_subscriptions_metric_id_metrics_id_fk",
+ "tableFrom": "goal_subscriptions",
+ "tableTo": "metrics",
+ "columnsFrom": ["metric_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "goal_subscriptions_user_id_users_id_fk": {
+ "name": "goal_subscriptions_user_id_users_id_fk",
+ "tableFrom": "goal_subscriptions",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "goal_subscriptions_workspace_id_workspaces_id_fk": {
+ "name": "goal_subscriptions_workspace_id_workspaces_id_fk",
+ "tableFrom": "goal_subscriptions",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "goal_subscriptions_confirmed_version_id_widget_versions_id_fk": {
+ "name": "goal_subscriptions_confirmed_version_id_widget_versions_id_fk",
+ "tableFrom": "goal_subscriptions",
+ "tableTo": "widget_versions",
+ "columnsFrom": ["confirmed_version_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21118,75 +25451,128 @@
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
- "goal_edges_distinct_nodes": {
- "name": "goal_edges_distinct_nodes",
- "value": "\"goal_edges\".\"source_node_id\" <> \"goal_edges\".\"target_node_id\""
+ "goal_subscriptions_binding_revision_positive": {
+ "name": "goal_subscriptions_binding_revision_positive",
+ "value": "\"goal_subscriptions\".\"binding_revision\" > 0"
}
},
"isRLSEnabled": false
},
- "public.goal_events": {
- "name": "goal_events",
+ "public.goal_traces": {
+ "name": "goal_traces",
"schema": "",
"columns": {
- "id": {
- "name": "id",
- "type": "uuid",
+ "goal_id": {
+ "name": "goal_id",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
+ },
+ "trace_s3_key": {
+ "name": "trace_s3_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_status": {
+ "name": "final_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "advances_total": {
+ "name": "advances_total",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
},
- "goal_id": {
- "name": "goal_id",
- "type": "text",
+ "ticks_total": {
+ "name": "ticks_total",
+ "type": "integer",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "event_type": {
- "name": "event_type",
- "type": "text",
+ "advances_by_trigger": {
+ "name": "advances_by_trigger",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "entity_type": {
- "name": "entity_type",
- "type": "text",
+ "advances_by_outcome": {
+ "name": "advances_by_outcome",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "entity_id": {
- "name": "entity_id",
- "type": "text",
+ "ticks_by_branch": {
+ "name": "ticks_by_branch",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "actor_type": {
- "name": "actor_type",
- "type": "text",
+ "total_cost": {
+ "name": "total_cost",
+ "type": "numeric(20, 6)",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "actor_id": {
- "name": "actor_id",
- "type": "text",
+ "work_operations": {
+ "name": "work_operations",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "task_id": {
- "name": "task_id",
- "type": "text",
+ "nodes_total": {
+ "name": "nodes_total",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "operation_id": {
- "name": "operation_id",
- "type": "text",
+ "work_resolved": {
+ "name": "work_resolved",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
- "reason": {
- "name": "reason",
- "type": "text",
+ "work_retired": {
+ "name": "work_retired",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "findings_total": {
+ "name": "findings_total",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gates_opened": {
+ "name": "gates_opened",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gates_resolved": {
+ "name": "gates_resolved",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "human_waiting_ms": {
+ "name": "human_waiting_ms",
+ "type": "integer",
"primaryKey": false,
"notNull": false
},
@@ -21196,56 +25582,21 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "goal_events_goal_id_created_at_idx": {
- "name": "goal_events_goal_id_created_at_idx",
- "columns": [
- {
- "expression": "goal_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "goal_events_entity_idx": {
- "name": "goal_events_entity_idx",
- "columns": [
- {
- "expression": "entity_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "entity_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "goal_events_task_id_idx": {
- "name": "goal_events_task_id_idx",
+ "goal_traces_started_at_idx": {
+ "name": "goal_traces_started_at_idx",
"columns": [
{
- "expression": "task_id",
+ "expression": "started_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21256,11 +25607,11 @@
"method": "btree",
"with": {}
},
- "goal_events_operation_id_idx": {
- "name": "goal_events_operation_id_idx",
+ "goal_traces_final_status_idx": {
+ "name": "goal_traces_final_status_idx",
"columns": [
{
- "expression": "operation_id",
+ "expression": "final_status",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21273,23 +25624,14 @@
}
},
"foreignKeys": {
- "goal_events_goal_id_goals_id_fk": {
- "name": "goal_events_goal_id_goals_id_fk",
- "tableFrom": "goal_events",
+ "goal_traces_goal_id_goals_id_fk": {
+ "name": "goal_traces_goal_id_goals_id_fk",
+ "tableFrom": "goal_traces",
"tableTo": "goals",
"columnsFrom": ["goal_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
- },
- "goal_events_task_id_tasks_id_fk": {
- "name": "goal_events_task_id_tasks_id_fk",
- "tableFrom": "goal_events",
- "tableTo": "tasks",
- "columnsFrom": ["task_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -21298,8 +25640,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.goal_node_decisions": {
- "name": "goal_node_decisions",
+ "public.inbound_webhooks": {
+ "name": "inbound_webhooks",
"schema": "",
"columns": {
"id": {
@@ -21309,18 +25651,30 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "node_id": {
- "name": "node_id",
- "type": "uuid",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "authority": {
- "name": "authority",
+ "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",
@@ -21328,71 +25682,99 @@
"notNull": true,
"default": "'pending'"
},
- "question": {
- "name": "question",
+ "agent_id": {
+ "name": "agent_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "options": {
- "name": "options",
- "type": "jsonb",
+ "topic_id": {
+ "name": "topic_id",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "recommended_option_id": {
- "name": "recommended_option_id",
+ "instructions": {
+ "name": "instructions",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "requested_user_id": {
- "name": "requested_user_id",
+ "secret": {
+ "name": "secret",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "requested_project_role": {
- "name": "requested_project_role",
- "type": "text",
+ "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
},
- "resolved_option_id": {
- "name": "resolved_option_id",
+ "dedupe_key": {
+ "name": "dedupe_key",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "resolution": {
- "name": "resolution",
- "type": "text",
+ "next_maintenance_at": {
+ "name": "next_maintenance_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "resolved_by_user_id": {
- "name": "resolved_by_user_id",
- "type": "text",
+ "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
},
- "resolved_by_agent_id": {
- "name": "resolved_by_agent_id",
+ "last_error": {
+ "name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "resolved_at": {
- "name": "resolved_at",
- "type": "timestamp with time zone",
+ "wake_count": {
+ "name": "wake_count",
+ "type": "integer",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": 0
},
- "canceled_at": {
- "name": "canceled_at",
+ "wake_window_started_at": {
+ "name": "wake_window_started_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
"accessed_at": {
"name": "accessed_at",
@@ -21417,41 +25799,55 @@
}
},
"indexes": {
- "goal_node_decisions_node_id_unique": {
- "name": "goal_node_decisions_node_id_unique",
+ "inbound_webhooks_user_kind_dedupe_unique": {
+ "name": "inbound_webhooks_user_kind_dedupe_unique",
"columns": [
{
- "expression": "node_id",
+ "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"
}
],
"isUnique": true,
+ "where": "\"inbound_webhooks\".\"dedupe_key\" IS NOT NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_node_decisions_status_idx": {
- "name": "goal_node_decisions_status_idx",
+ "inbound_webhooks_next_maintenance_idx": {
+ "name": "inbound_webhooks_next_maintenance_idx",
"columns": [
{
- "expression": "status",
+ "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": {}
},
- "goal_node_decisions_resolved_by_user_id_idx": {
- "name": "goal_node_decisions_resolved_by_user_id_idx",
+ "inbound_webhooks_user_idx": {
+ "name": "inbound_webhooks_user_idx",
"columns": [
{
- "expression": "resolved_by_user_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21462,17 +25858,11 @@
"method": "btree",
"with": {}
},
- "goal_node_decisions_requested_user_id_status_idx": {
- "name": "goal_node_decisions_requested_user_id_status_idx",
+ "inbound_webhooks_workspace_idx": {
+ "name": "inbound_webhooks_workspace_idx",
"columns": [
{
- "expression": "requested_user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "status",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21482,122 +25872,42 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "goal_node_decisions_node_id_goal_nodes_id_fk": {
- "name": "goal_node_decisions_node_id_goal_nodes_id_fk",
- "tableFrom": "goal_node_decisions",
- "tableTo": "goal_nodes",
- "columnsFrom": ["node_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_node_decisions_requested_user_id_users_id_fk": {
- "name": "goal_node_decisions_requested_user_id_users_id_fk",
- "tableFrom": "goal_node_decisions",
- "tableTo": "users",
- "columnsFrom": ["requested_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "goal_node_decisions_resolved_by_user_id_users_id_fk": {
- "name": "goal_node_decisions_resolved_by_user_id_users_id_fk",
- "tableFrom": "goal_node_decisions",
- "tableTo": "users",
- "columnsFrom": ["resolved_by_user_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "goal_node_decisions_resolved_by_agent_id_agents_id_fk": {
- "name": "goal_node_decisions_resolved_by_agent_id_agents_id_fk",
- "tableFrom": "goal_node_decisions",
- "tableTo": "agents",
- "columnsFrom": ["resolved_by_agent_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.goal_node_work_versions": {
- "name": "goal_node_work_versions",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "node_id": {
- "name": "node_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "work_version_id": {
- "name": "work_version_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "relation": {
- "name": "relation",
- "type": "text",
- "primaryKey": false,
- "notNull": true
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "goal_node_work_versions_node_version_relation_unique": {
- "name": "goal_node_work_versions_node_version_relation_unique",
+ "inbound_webhooks_topic_idx": {
+ "name": "inbound_webhooks_topic_idx",
"columns": [
{
- "expression": "node_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "work_version_id",
+ "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": "relation",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_node_work_versions_work_version_id_idx": {
- "name": "goal_node_work_versions_work_version_id_idx",
+ "inbound_webhooks_connector_idx": {
+ "name": "inbound_webhooks_connector_idx",
"columns": [
{
- "expression": "work_version_id",
+ "expression": "connector_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21610,20 +25920,47 @@
}
},
"foreignKeys": {
- "goal_node_work_versions_node_id_goal_nodes_id_fk": {
- "name": "goal_node_work_versions_node_id_goal_nodes_id_fk",
- "tableFrom": "goal_node_work_versions",
- "tableTo": "goal_nodes",
- "columnsFrom": ["node_id"],
+ "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"
},
- "goal_node_work_versions_work_version_id_work_versions_id_fk": {
- "name": "goal_node_work_versions_work_version_id_work_versions_id_fk",
- "tableFrom": "goal_node_work_versions",
- "tableTo": "work_versions",
- "columnsFrom": ["work_version_id"],
+ "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"
@@ -21635,8 +25972,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.goal_nodes": {
- "name": "goal_nodes",
+ "public.linear_connections": {
+ "name": "linear_connections",
"schema": "",
"columns": {
"id": {
@@ -21646,73 +25983,72 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "goal_id": {
- "name": "goal_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "kind": {
- "name": "kind",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "status": {
- "name": "status",
- "type": "text",
+ "organization_id": {
+ "name": "organization_id",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": true,
- "default": "'proposed'"
+ "notNull": true
},
- "title": {
- "name": "title",
- "type": "text",
+ "organization_name": {
+ "name": "organization_name",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
- "description": {
- "name": "description",
- "type": "text",
+ "organization_url_key": {
+ "name": "organization_url_key",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "task_id": {
- "name": "task_id",
- "type": "text",
+ "actor_external_id": {
+ "name": "actor_external_id",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "priority": {
- "name": "priority",
- "type": "integer",
+ "actor_name": {
+ "name": "actor_name",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": true
},
- "confidence": {
- "name": "confidence",
- "type": "numeric(4, 3)",
+ "credentials": {
+ "name": "credentials",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "created_by_user_id": {
- "name": "created_by_user_id",
- "type": "text",
+ "token_expires_at": {
+ "name": "token_expires_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "created_by_agent_id": {
- "name": "created_by_agent_id",
- "type": "text",
+ "revoked_at": {
+ "name": "revoked_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "resolved_at": {
- "name": "resolved_at",
- "type": "timestamp with time zone",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'{}'::jsonb"
},
"accessed_at": {
"name": "accessed_at",
@@ -21737,53 +26073,61 @@
}
},
"indexes": {
- "goal_nodes_goal_id_status_idx": {
- "name": "goal_nodes_goal_id_status_idx",
+ "linear_connections_org_personal_unique": {
+ "name": "linear_connections_org_personal_unique",
"columns": [
{
- "expression": "goal_id",
+ "expression": "organization_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "status",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"linear_connections\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_nodes_created_by_user_id_idx": {
- "name": "goal_nodes_created_by_user_id_idx",
+ "linear_connections_org_workspace_unique": {
+ "name": "linear_connections_org_workspace_unique",
"columns": [
{
- "expression": "created_by_user_id",
+ "expression": "organization_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"linear_connections\".\"workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_nodes_goal_id_kind_idx": {
- "name": "goal_nodes_goal_id_kind_idx",
+ "linear_connections_user_id_idx": {
+ "name": "linear_connections_user_id_idx",
"columns": [
{
- "expression": "goal_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "kind",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -21794,94 +26138,71 @@
"method": "btree",
"with": {}
},
- "goal_nodes_task_id_unique": {
- "name": "goal_nodes_task_id_unique",
+ "linear_connections_workspace_id_idx": {
+ "name": "linear_connections_workspace_id_idx",
"columns": [
{
- "expression": "task_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"goal_nodes\".\"task_id\" is not null",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "goal_nodes_goal_id_goals_id_fk": {
- "name": "goal_nodes_goal_id_goals_id_fk",
- "tableFrom": "goal_nodes",
- "tableTo": "goals",
- "columnsFrom": ["goal_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_nodes_task_id_tasks_id_fk": {
- "name": "goal_nodes_task_id_tasks_id_fk",
- "tableFrom": "goal_nodes",
- "tableTo": "tasks",
- "columnsFrom": ["task_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "goal_nodes_created_by_user_id_users_id_fk": {
- "name": "goal_nodes_created_by_user_id_users_id_fk",
- "tableFrom": "goal_nodes",
+ "linear_connections_user_id_users_id_fk": {
+ "name": "linear_connections_user_id_users_id_fk",
+ "tableFrom": "linear_connections",
"tableTo": "users",
- "columnsFrom": ["created_by_user_id"],
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "goal_nodes_created_by_agent_id_agents_id_fk": {
- "name": "goal_nodes_created_by_agent_id_agents_id_fk",
- "tableFrom": "goal_nodes",
- "tableTo": "agents",
- "columnsFrom": ["created_by_agent_id"],
+ "linear_connections_workspace_id_workspaces_id_fk": {
+ "name": "linear_connections_workspace_id_workspaces_id_fk",
+ "tableFrom": "linear_connections",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "goal_nodes_goal_id_id_unique": {
- "name": "goal_nodes_goal_id_id_unique",
- "nullsNotDistinct": false,
- "columns": ["goal_id", "id"]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
- "checkConstraints": {
- "goal_nodes_confidence_range": {
- "name": "goal_nodes_confidence_range",
- "value": "\"goal_nodes\".\"confidence\" IS NULL OR (\"goal_nodes\".\"confidence\" >= 0 AND \"goal_nodes\".\"confidence\" <= 1)"
- }
- },
+ "checkConstraints": {},
"isRLSEnabled": false
},
- "public.goal_shares": {
- "name": "goal_shares",
+ "public.linear_sync_rules": {
+ "name": "linear_sync_rules",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "text",
+ "type": "uuid",
"primaryKey": true,
- "notNull": true
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "goal_id": {
- "name": "goal_id",
+ "project_id": {
+ "name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
+ "connection_id": {
+ "name": "connection_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
"user_id": {
"name": "user_id",
"type": "text",
@@ -21894,31 +26215,47 @@
"primaryKey": false,
"notNull": false
},
- "page_view_count": {
- "name": "page_view_count",
- "type": "integer",
+ "team_id": {
+ "name": "team_id",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": true,
- "default": 0
+ "notNull": true
},
- "config": {
- "name": "config",
- "type": "jsonb",
+ "team_name": {
+ "name": "team_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "linear_project_id": {
+ "name": "linear_project_id",
+ "type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
+ "linear_project_name": {
+ "name": "linear_project_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "state_types": {
+ "name": "state_types",
"type": "jsonb",
"primaryKey": false,
+ "notNull": true
+ },
+ "last_run_at": {
+ "name": "last_run_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
"notNull": false
},
- "visibility": {
- "name": "visibility",
- "type": "text",
+ "last_result": {
+ "name": "last_result",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "'private'"
+ "notNull": false
},
"accessed_at": {
"name": "accessed_at",
@@ -21943,23 +26280,38 @@
}
},
"indexes": {
- "goal_shares_goal_id_unique": {
- "name": "goal_shares_goal_id_unique",
+ "linear_sync_rules_project_id_idx": {
+ "name": "linear_sync_rules_project_id_idx",
"columns": [
{
- "expression": "goal_id",
+ "expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_shares_user_id_idx": {
- "name": "goal_shares_user_id_idx",
+ "linear_sync_rules_connection_id_idx": {
+ "name": "linear_sync_rules_connection_id_idx",
+ "columns": [
+ {
+ "expression": "connection_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "linear_sync_rules_user_id_idx": {
+ "name": "linear_sync_rules_user_id_idx",
"columns": [
{
"expression": "user_id",
@@ -21973,8 +26325,8 @@
"method": "btree",
"with": {}
},
- "goal_shares_workspace_id_idx": {
- "name": "goal_shares_workspace_id_idx",
+ "linear_sync_rules_workspace_id_idx": {
+ "name": "linear_sync_rules_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
@@ -21990,27 +26342,36 @@
}
},
"foreignKeys": {
- "goal_shares_goal_id_goals_id_fk": {
- "name": "goal_shares_goal_id_goals_id_fk",
- "tableFrom": "goal_shares",
- "tableTo": "goals",
- "columnsFrom": ["goal_id"],
+ "linear_sync_rules_project_id_projects_id_fk": {
+ "name": "linear_sync_rules_project_id_projects_id_fk",
+ "tableFrom": "linear_sync_rules",
+ "tableTo": "projects",
+ "columnsFrom": ["project_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "goal_shares_user_id_users_id_fk": {
- "name": "goal_shares_user_id_users_id_fk",
- "tableFrom": "goal_shares",
+ "linear_sync_rules_connection_id_linear_connections_id_fk": {
+ "name": "linear_sync_rules_connection_id_linear_connections_id_fk",
+ "tableFrom": "linear_sync_rules",
+ "tableTo": "linear_connections",
+ "columnsFrom": ["connection_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "linear_sync_rules_user_id_users_id_fk": {
+ "name": "linear_sync_rules_user_id_users_id_fk",
+ "tableFrom": "linear_sync_rules",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "goal_shares_workspace_id_workspaces_id_fk": {
- "name": "goal_shares_workspace_id_workspaces_id_fk",
- "tableFrom": "goal_shares",
+ "linear_sync_rules_workspace_id_workspaces_id_fk": {
+ "name": "linear_sync_rules_workspace_id_workspaces_id_fk",
+ "tableFrom": "linear_sync_rules",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
@@ -22024,8 +26385,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.goal_subscriptions": {
- "name": "goal_subscriptions",
+ "public.llm_generation_tracing": {
+ "name": "llm_generation_tracing",
"schema": "",
"columns": {
"id": {
@@ -22035,20 +26396,26 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "goal_id": {
- "name": "goal_id",
+ "scenario": {
+ "name": "scenario",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "widget_id": {
- "name": "widget_id",
- "type": "uuid",
+ "prompt_version": {
+ "name": "prompt_version",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "metric_id": {
- "name": "metric_id",
+ "prompt_hash": {
+ "name": "prompt_hash",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "schema_name": {
+ "name": "schema_name",
"type": "text",
"primaryKey": false,
"notNull": false
@@ -22059,73 +26426,166 @@
"primaryKey": false,
"notNull": true
},
+ "agent_id": {
+ "name": "agent_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "topic_id": {
+ "name": "topic_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "enabled": {
- "name": "enabled",
+ "trigger": {
+ "name": "trigger",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_tracing_id": {
+ "name": "parent_tracing_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "provider": {
+ "name": "provider",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "model": {
+ "name": "model",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error_code": {
+ "name": "error_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_detail": {
+ "name": "error_detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "validation_failed": {
+ "name": "validation_failed",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
- "confirmed_version_id": {
- "name": "confirmed_version_id",
- "type": "uuid",
+ "input_hash": {
+ "name": "input_hash",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "binding_revision": {
- "name": "binding_revision",
+ "input_hint": {
+ "name": "input_hint",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latency_ms": {
+ "name": "latency_ms",
"type": "integer",
"primaryKey": false,
- "notNull": true,
- "default": 1
+ "notNull": false
},
- "binding": {
- "name": "binding",
- "type": "jsonb",
+ "input_tokens": {
+ "name": "input_tokens",
+ "type": "integer",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "wake_condition": {
- "name": "wake_condition",
- "type": "jsonb",
+ "output_tokens": {
+ "name": "output_tokens",
+ "type": "integer",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "freshness_policy": {
- "name": "freshness_policy",
- "type": "jsonb",
+ "cost_usd": {
+ "name": "cost_usd",
+ "type": "numeric(12, 8)",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "cursor": {
- "name": "cursor",
+ "storage_key": {
+ "name": "storage_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "feedback_signal": {
+ "name": "feedback_signal",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "feedback_score": {
+ "name": "feedback_score",
+ "type": "numeric(3, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "feedback_source": {
+ "name": "feedback_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "feedback_data": {
+ "name": "feedback_data",
"type": "jsonb",
"primaryKey": false,
- "notNull": true,
- "default": "'{}'::jsonb"
+ "notNull": false
},
- "accessed_at": {
- "name": "accessed_at",
+ "feedback_updated_at": {
+ "name": "feedback_updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
+ "trace_id": {
+ "name": "trace_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
- "updated_at": {
- "name": "updated_at",
+ "span_id": {
+ "name": "span_id",
+ "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,
@@ -22133,117 +26593,116 @@
}
},
"indexes": {
- "goal_subscriptions_goal_widget_metric_unique": {
- "name": "goal_subscriptions_goal_widget_metric_unique",
+ "llm_generation_tracing_scenario_idx": {
+ "name": "llm_generation_tracing_scenario_idx",
"columns": [
{
- "expression": "goal_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "widget_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "metric_id",
+ "expression": "scenario",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"goal_subscriptions\".\"metric_id\" IS NOT NULL",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_subscriptions_goal_widget_result_unique": {
- "name": "goal_subscriptions_goal_widget_result_unique",
+ "llm_generation_tracing_prompt_version_idx": {
+ "name": "llm_generation_tracing_prompt_version_idx",
"columns": [
{
- "expression": "goal_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "widget_id",
+ "expression": "prompt_version",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"goal_subscriptions\".\"metric_id\" IS NULL",
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_subscriptions_widget_enabled_idx": {
- "name": "goal_subscriptions_widget_enabled_idx",
+ "llm_generation_tracing_user_id_idx": {
+ "name": "llm_generation_tracing_user_id_idx",
"columns": [
{
- "expression": "widget_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "llm_generation_tracing_agent_id_idx": {
+ "name": "llm_generation_tracing_agent_id_idx",
+ "columns": [
{
- "expression": "workspace_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "llm_generation_tracing_topic_id_idx": {
+ "name": "llm_generation_tracing_topic_id_idx",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"goal_subscriptions\".\"enabled\" = true",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_subscriptions_personal_idx": {
- "name": "goal_subscriptions_personal_idx",
+ "llm_generation_tracing_workspace_id_idx": {
+ "name": "llm_generation_tracing_workspace_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "llm_generation_tracing_provider_idx": {
+ "name": "llm_generation_tracing_provider_idx",
+ "columns": [
{
- "expression": "goal_id",
+ "expression": "provider",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"goal_subscriptions\".\"workspace_id\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
},
- "goal_subscriptions_workspace_idx": {
- "name": "goal_subscriptions_workspace_idx",
+ "llm_generation_tracing_model_idx": {
+ "name": "llm_generation_tracing_model_idx",
"columns": [
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "goal_id",
+ "expression": "model",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22254,11 +26713,11 @@
"method": "btree",
"with": {}
},
- "goal_subscriptions_metric_id_idx": {
- "name": "goal_subscriptions_metric_id_idx",
+ "llm_generation_tracing_success_idx": {
+ "name": "llm_generation_tracing_success_idx",
"columns": [
{
- "expression": "metric_id",
+ "expression": "success",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22269,11 +26728,11 @@
"method": "btree",
"with": {}
},
- "goal_subscriptions_confirmed_version_id_idx": {
- "name": "goal_subscriptions_confirmed_version_id_idx",
+ "llm_generation_tracing_error_code_idx": {
+ "name": "llm_generation_tracing_error_code_idx",
"columns": [
{
- "expression": "confirmed_version_id",
+ "expression": "error_code",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22284,235 +26743,26 @@
"method": "btree",
"with": {}
},
- "goal_subscriptions_reconcile_idx": {
- "name": "goal_subscriptions_reconcile_idx",
+ "llm_generation_tracing_validation_failed_idx": {
+ "name": "llm_generation_tracing_validation_failed_idx",
"columns": [
{
- "expression": "updated_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "id",
+ "expression": "validation_failed",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"goal_subscriptions\".\"enabled\" = true",
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "goal_subscriptions_goal_id_goals_id_fk": {
- "name": "goal_subscriptions_goal_id_goals_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "goals",
- "columnsFrom": ["goal_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_subscriptions_widget_id_widgets_id_fk": {
- "name": "goal_subscriptions_widget_id_widgets_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "widgets",
- "columnsFrom": ["widget_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_subscriptions_metric_id_metrics_id_fk": {
- "name": "goal_subscriptions_metric_id_metrics_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "metrics",
- "columnsFrom": ["metric_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_subscriptions_user_id_users_id_fk": {
- "name": "goal_subscriptions_user_id_users_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_subscriptions_workspace_id_workspaces_id_fk": {
- "name": "goal_subscriptions_workspace_id_workspaces_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "goal_subscriptions_confirmed_version_id_widget_versions_id_fk": {
- "name": "goal_subscriptions_confirmed_version_id_widget_versions_id_fk",
- "tableFrom": "goal_subscriptions",
- "tableTo": "widget_versions",
- "columnsFrom": ["confirmed_version_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {
- "goal_subscriptions_binding_revision_positive": {
- "name": "goal_subscriptions_binding_revision_positive",
- "value": "\"goal_subscriptions\".\"binding_revision\" > 0"
- }
- },
- "isRLSEnabled": false
- },
- "public.goal_traces": {
- "name": "goal_traces",
- "schema": "",
- "columns": {
- "goal_id": {
- "name": "goal_id",
- "type": "text",
- "primaryKey": true,
- "notNull": true
- },
- "trace_s3_key": {
- "name": "trace_s3_key",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "started_at": {
- "name": "started_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "completed_at": {
- "name": "completed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "final_status": {
- "name": "final_status",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "advances_total": {
- "name": "advances_total",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "ticks_total": {
- "name": "ticks_total",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "advances_by_trigger": {
- "name": "advances_by_trigger",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "advances_by_outcome": {
- "name": "advances_by_outcome",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "ticks_by_branch": {
- "name": "ticks_by_branch",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "total_cost": {
- "name": "total_cost",
- "type": "numeric(20, 6)",
- "primaryKey": false,
- "notNull": false
- },
- "work_operations": {
- "name": "work_operations",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "nodes_total": {
- "name": "nodes_total",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "work_resolved": {
- "name": "work_resolved",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "work_retired": {
- "name": "work_retired",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "findings_total": {
- "name": "findings_total",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "gates_opened": {
- "name": "gates_opened",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "gates_resolved": {
- "name": "gates_resolved",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "human_waiting_ms": {
- "name": "human_waiting_ms",
- "type": "integer",
- "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": {
- "goal_traces_started_at_idx": {
- "name": "goal_traces_started_at_idx",
+ "llm_generation_tracing_feedback_signal_idx": {
+ "name": "llm_generation_tracing_feedback_signal_idx",
"columns": [
{
- "expression": "started_at",
+ "expression": "feedback_signal",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22523,11 +26773,11 @@
"method": "btree",
"with": {}
},
- "goal_traces_final_status_idx": {
- "name": "goal_traces_final_status_idx",
+ "llm_generation_tracing_created_at_idx": {
+ "name": "llm_generation_tracing_created_at_idx",
"columns": [
{
- "expression": "final_status",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22540,11 +26790,11 @@
}
},
"foreignKeys": {
- "goal_traces_goal_id_goals_id_fk": {
- "name": "goal_traces_goal_id_goals_id_fk",
- "tableFrom": "goal_traces",
- "tableTo": "goals",
- "columnsFrom": ["goal_id"],
+ "llm_generation_tracing_workspace_id_workspaces_id_fk": {
+ "name": "llm_generation_tracing_workspace_id_workspaces_id_fk",
+ "tableFrom": "llm_generation_tracing",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
@@ -22556,8 +26806,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.linear_connections": {
- "name": "linear_connections",
+ "public.meeting_minutes": {
+ "name": "meeting_minutes",
"schema": "",
"columns": {
"id": {
@@ -22567,73 +26817,58 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "meeting_id": {
+ "name": "meeting_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "summary": {
+ "name": "summary",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "organization_id": {
- "name": "organization_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": true
- },
- "organization_name": {
- "name": "organization_name",
- "type": "varchar(255)",
+ "chapters": {
+ "name": "chapters",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "organization_url_key": {
- "name": "organization_url_key",
- "type": "varchar(255)",
+ "decisions": {
+ "name": "decisions",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "actor_external_id": {
- "name": "actor_external_id",
- "type": "varchar(255)",
+ "action_items": {
+ "name": "action_items",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "actor_name": {
- "name": "actor_name",
- "type": "varchar(255)",
+ "keywords": {
+ "name": "keywords",
+ "type": "jsonb",
"primaryKey": false,
- "notNull": true
+ "notNull": true,
+ "default": "'[]'::jsonb"
},
- "credentials": {
- "name": "credentials",
+ "document_id": {
+ "name": "document_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "token_expires_at": {
- "name": "token_expires_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "revoked_at": {
- "name": "revoked_at",
- "type": "timestamp with time zone",
+ "model": {
+ "name": "model",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": true,
- "default": "'{}'::jsonb"
- },
"accessed_at": {
"name": "accessed_at",
"type": "timestamp with time zone",
@@ -22657,76 +26892,26 @@
}
},
"indexes": {
- "linear_connections_org_personal_unique": {
- "name": "linear_connections_org_personal_unique",
- "columns": [
- {
- "expression": "organization_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"linear_connections\".\"workspace_id\" is null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "linear_connections_org_workspace_unique": {
- "name": "linear_connections_org_workspace_unique",
+ "meeting_minutes_meeting_id_unique": {
+ "name": "meeting_minutes_meeting_id_unique",
"columns": [
{
- "expression": "organization_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "workspace_id",
+ "expression": "meeting_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"linear_connections\".\"workspace_id\" is not null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "linear_connections_user_id_idx": {
- "name": "linear_connections_user_id_idx",
- "columns": [
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "linear_connections_workspace_id_idx": {
- "name": "linear_connections_workspace_id_idx",
+ "meeting_minutes_document_id_idx": {
+ "name": "meeting_minutes_document_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "document_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22739,22 +26924,22 @@
}
},
"foreignKeys": {
- "linear_connections_user_id_users_id_fk": {
- "name": "linear_connections_user_id_users_id_fk",
- "tableFrom": "linear_connections",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "meeting_minutes_meeting_id_meetings_id_fk": {
+ "name": "meeting_minutes_meeting_id_meetings_id_fk",
+ "tableFrom": "meeting_minutes",
+ "tableTo": "meetings",
+ "columnsFrom": ["meeting_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "linear_connections_workspace_id_workspaces_id_fk": {
- "name": "linear_connections_workspace_id_workspaces_id_fk",
- "tableFrom": "linear_connections",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "meeting_minutes_document_id_documents_id_fk": {
+ "name": "meeting_minutes_document_id_documents_id_fk",
+ "tableFrom": "meeting_minutes",
+ "tableTo": "documents",
+ "columnsFrom": ["document_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
@@ -22764,8 +26949,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.linear_sync_rules": {
- "name": "linear_sync_rules",
+ "public.meeting_segments": {
+ "name": "meeting_segments",
"schema": "",
"columns": {
"id": {
@@ -22775,71 +26960,47 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "project_id": {
- "name": "project_id",
- "type": "text",
+ "meeting_id": {
+ "name": "meeting_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "connection_id": {
- "name": "connection_id",
+ "speaker_id": {
+ "name": "speaker_id",
"type": "uuid",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "user_id": {
- "name": "user_id",
+ "source": {
+ "name": "source",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "team_id": {
- "name": "team_id",
- "type": "varchar(255)",
+ "seq": {
+ "name": "seq",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "team_name": {
- "name": "team_name",
- "type": "varchar(255)",
+ "start_ms": {
+ "name": "start_ms",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "linear_project_id": {
- "name": "linear_project_id",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "linear_project_name": {
- "name": "linear_project_name",
- "type": "varchar(255)",
- "primaryKey": false,
- "notNull": false
- },
- "state_types": {
- "name": "state_types",
- "type": "jsonb",
+ "end_ms": {
+ "name": "end_ms",
+ "type": "integer",
"primaryKey": false,
"notNull": true
},
- "last_run_at": {
- "name": "last_run_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "last_result": {
- "name": "last_result",
- "type": "jsonb",
+ "text": {
+ "name": "text",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
"accessed_at": {
"name": "accessed_at",
@@ -22864,41 +27025,50 @@
}
},
"indexes": {
- "linear_sync_rules_project_id_idx": {
- "name": "linear_sync_rules_project_id_idx",
+ "meeting_segments_meeting_id_source_seq_unique": {
+ "name": "meeting_segments_meeting_id_source_seq_unique",
"columns": [
{
- "expression": "project_id",
+ "expression": "meeting_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "source",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "seq",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "linear_sync_rules_connection_id_idx": {
- "name": "linear_sync_rules_connection_id_idx",
+ "meeting_segments_meeting_id_source_start_ms_idx": {
+ "name": "meeting_segments_meeting_id_source_start_ms_idx",
"columns": [
{
- "expression": "connection_id",
+ "expression": "meeting_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "linear_sync_rules_user_id_idx": {
- "name": "linear_sync_rules_user_id_idx",
- "columns": [
+ },
{
- "expression": "user_id",
+ "expression": "source",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "start_ms",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22909,11 +27079,11 @@
"method": "btree",
"with": {}
},
- "linear_sync_rules_workspace_id_idx": {
- "name": "linear_sync_rules_workspace_id_idx",
+ "meeting_segments_speaker_id_idx": {
+ "name": "meeting_segments_speaker_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "speaker_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -22926,40 +27096,22 @@
}
},
"foreignKeys": {
- "linear_sync_rules_project_id_projects_id_fk": {
- "name": "linear_sync_rules_project_id_projects_id_fk",
- "tableFrom": "linear_sync_rules",
- "tableTo": "projects",
- "columnsFrom": ["project_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "linear_sync_rules_connection_id_linear_connections_id_fk": {
- "name": "linear_sync_rules_connection_id_linear_connections_id_fk",
- "tableFrom": "linear_sync_rules",
- "tableTo": "linear_connections",
- "columnsFrom": ["connection_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "linear_sync_rules_user_id_users_id_fk": {
- "name": "linear_sync_rules_user_id_users_id_fk",
- "tableFrom": "linear_sync_rules",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "meeting_segments_meeting_id_meetings_id_fk": {
+ "name": "meeting_segments_meeting_id_meetings_id_fk",
+ "tableFrom": "meeting_segments",
+ "tableTo": "meetings",
+ "columnsFrom": ["meeting_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "linear_sync_rules_workspace_id_workspaces_id_fk": {
- "name": "linear_sync_rules_workspace_id_workspaces_id_fk",
- "tableFrom": "linear_sync_rules",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "meeting_segments_speaker_id_meeting_speakers_id_fk": {
+ "name": "meeting_segments_speaker_id_meeting_speakers_id_fk",
+ "tableFrom": "meeting_segments",
+ "tableTo": "meeting_speakers",
+ "columnsFrom": ["speaker_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
@@ -22969,8 +27121,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.llm_generation_tracing": {
- "name": "llm_generation_tracing",
+ "public.meeting_speakers": {
+ "name": "meeting_speakers",
"schema": "",
"columns": {
"id": {
@@ -22980,47 +27132,102 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "scenario": {
- "name": "scenario",
- "type": "text",
+ "meeting_id": {
+ "name": "meeting_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": true
},
- "prompt_version": {
- "name": "prompt_version",
+ "label": {
+ "name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "prompt_hash": {
- "name": "prompt_hash",
+ "display_name": {
+ "name": "display_name",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "schema_name": {
- "name": "schema_name",
- "type": "text",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "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()"
},
- "agent_id": {
- "name": "agent_id",
- "type": "text",
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "meeting_speakers_meeting_id_label_unique": {
+ "name": "meeting_speakers_meeting_id_label_unique",
+ "columns": [
+ {
+ "expression": "meeting_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "label",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "meeting_speakers_meeting_id_meetings_id_fk": {
+ "name": "meeting_speakers_meeting_id_meetings_id_fk",
+ "tableFrom": "meeting_speakers",
+ "tableTo": "meetings",
+ "columnsFrom": ["meeting_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.meetings": {
+ "name": "meetings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
},
- "topic_id": {
- "name": "topic_id",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
"workspace_id": {
"name": "workspace_id",
@@ -23028,145 +27235,94 @@
"primaryKey": false,
"notNull": false
},
- "trigger": {
- "name": "trigger",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "parent_tracing_id": {
- "name": "parent_tracing_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "provider": {
- "name": "provider",
+ "status": {
+ "name": "status",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'recording'"
},
- "model": {
- "name": "model",
+ "platform": {
+ "name": "platform",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "success": {
- "name": "success",
- "type": "boolean",
- "primaryKey": false,
"notNull": true
},
- "error_code": {
- "name": "error_code",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "error_detail": {
- "name": "error_detail",
+ "realtime_provider": {
+ "name": "realtime_provider",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "validation_failed": {
- "name": "validation_failed",
- "type": "boolean",
- "primaryKey": false,
- "notNull": true,
- "default": false
+ "notNull": true
},
- "input_hash": {
- "name": "input_hash",
+ "refine_provider": {
+ "name": "refine_provider",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true
},
- "input_hint": {
- "name": "input_hint",
+ "language": {
+ "name": "language",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'auto'"
},
- "latency_ms": {
- "name": "latency_ms",
- "type": "integer",
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "now()"
},
- "input_tokens": {
- "name": "input_tokens",
- "type": "integer",
+ "ended_at": {
+ "name": "ended_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
- "output_tokens": {
- "name": "output_tokens",
+ "duration_ms": {
+ "name": "duration_ms",
"type": "integer",
"primaryKey": false,
"notNull": false
},
- "cost_usd": {
- "name": "cost_usd",
- "type": "numeric(12, 8)",
- "primaryKey": false,
- "notNull": false
- },
- "storage_key": {
- "name": "storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "feedback_signal": {
- "name": "feedback_signal",
+ "audio_file_id": {
+ "name": "audio_file_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "feedback_score": {
- "name": "feedback_score",
- "type": "numeric(3, 2)",
- "primaryKey": false,
- "notNull": false
- },
- "feedback_source": {
- "name": "feedback_source",
+ "local_audio_path": {
+ "name": "local_audio_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "feedback_data": {
- "name": "feedback_data",
+ "error": {
+ "name": "error",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
- "feedback_updated_at": {
- "name": "feedback_updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "trace_id": {
- "name": "trace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "span_id": {
- "name": "span_id",
+ "visibility": {
+ "name": "visibility",
"type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'private'"
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "accessed_at": {
+ "name": "accessed_at",
+ "type": "timestamp with time zone",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": true,
+ "default": "now()"
},
"created_at": {
"name": "created_at",
@@ -23174,149 +27330,33 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
}
},
"indexes": {
- "llm_generation_tracing_scenario_idx": {
- "name": "llm_generation_tracing_scenario_idx",
- "columns": [
- {
- "expression": "scenario",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_prompt_version_idx": {
- "name": "llm_generation_tracing_prompt_version_idx",
- "columns": [
- {
- "expression": "prompt_version",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_user_id_idx": {
- "name": "llm_generation_tracing_user_id_idx",
+ "meetings_user_id_workspace_id_created_at_idx": {
+ "name": "meetings_user_id_workspace_id_created_at_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_agent_id_idx": {
- "name": "llm_generation_tracing_agent_id_idx",
- "columns": [
- {
- "expression": "agent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_topic_id_idx": {
- "name": "llm_generation_tracing_topic_id_idx",
- "columns": [
- {
- "expression": "topic_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_workspace_id_idx": {
- "name": "llm_generation_tracing_workspace_id_idx",
- "columns": [
+ },
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_provider_idx": {
- "name": "llm_generation_tracing_provider_idx",
- "columns": [
- {
- "expression": "provider",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_model_idx": {
- "name": "llm_generation_tracing_model_idx",
- "columns": [
- {
- "expression": "model",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_success_idx": {
- "name": "llm_generation_tracing_success_idx",
- "columns": [
- {
- "expression": "success",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_error_code_idx": {
- "name": "llm_generation_tracing_error_code_idx",
- "columns": [
+ },
{
- "expression": "error_code",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -23327,26 +27367,17 @@
"method": "btree",
"with": {}
},
- "llm_generation_tracing_validation_failed_idx": {
- "name": "llm_generation_tracing_validation_failed_idx",
+ "meetings_workspace_id_created_at_idx": {
+ "name": "meetings_workspace_id_created_at_idx",
"columns": [
{
- "expression": "validation_failed",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "llm_generation_tracing_feedback_signal_idx": {
- "name": "llm_generation_tracing_feedback_signal_idx",
- "columns": [
+ },
{
- "expression": "feedback_signal",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -23357,11 +27388,11 @@
"method": "btree",
"with": {}
},
- "llm_generation_tracing_created_at_idx": {
- "name": "llm_generation_tracing_created_at_idx",
+ "meetings_audio_file_id_idx": {
+ "name": "meetings_audio_file_id_idx",
"columns": [
{
- "expression": "created_at",
+ "expression": "audio_file_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -23374,14 +27405,32 @@
}
},
"foreignKeys": {
- "llm_generation_tracing_workspace_id_workspaces_id_fk": {
- "name": "llm_generation_tracing_workspace_id_workspaces_id_fk",
- "tableFrom": "llm_generation_tracing",
+ "meetings_user_id_users_id_fk": {
+ "name": "meetings_user_id_users_id_fk",
+ "tableFrom": "meetings",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "meetings_workspace_id_workspaces_id_fk": {
+ "name": "meetings_workspace_id_workspaces_id_fk",
+ "tableFrom": "meetings",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
+ },
+ "meetings_audio_file_id_files_id_fk": {
+ "name": "meetings_audio_file_id_files_id_fk",
+ "tableFrom": "meetings",
+ "tableTo": "files",
+ "columnsFrom": ["audio_file_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -46962,414 +51011,32 @@
"with": {}
},
"work_versions_work_id_tool_call_id_unique": {
- "name": "work_versions_work_id_tool_call_id_unique",
- "columns": [
- {
- "expression": "work_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "tool_call_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"work_versions\".\"tool_call_id\" is not null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_thread_id_idx": {
- "name": "work_versions_thread_id_idx",
- "columns": [
- {
- "expression": "thread_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_message_id_idx": {
- "name": "work_versions_message_id_idx",
- "columns": [
- {
- "expression": "message_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_agent_id_idx": {
- "name": "work_versions_agent_id_idx",
- "columns": [
- {
- "expression": "agent_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_root_operation_created_at_idx": {
- "name": "work_versions_root_operation_created_at_idx",
- "columns": [
- {
- "expression": "root_operation_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_topic_created_at_idx": {
- "name": "work_versions_topic_created_at_idx",
- "columns": [
- {
- "expression": "topic_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "work_versions_topic_thread_created_at_idx": {
- "name": "work_versions_topic_thread_created_at_idx",
- "columns": [
- {
- "expression": "topic_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "thread_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- }
- },
- "foreignKeys": {
- "work_versions_work_id_works_id_fk": {
- "name": "work_versions_work_id_works_id_fk",
- "tableFrom": "work_versions",
- "tableTo": "works",
- "columnsFrom": ["work_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "work_versions_topic_id_topics_id_fk": {
- "name": "work_versions_topic_id_topics_id_fk",
- "tableFrom": "work_versions",
- "tableTo": "topics",
- "columnsFrom": ["topic_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "work_versions_thread_id_threads_id_fk": {
- "name": "work_versions_thread_id_threads_id_fk",
- "tableFrom": "work_versions",
- "tableTo": "threads",
- "columnsFrom": ["thread_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "work_versions_message_id_messages_id_fk": {
- "name": "work_versions_message_id_messages_id_fk",
- "tableFrom": "work_versions",
- "tableTo": "messages",
- "columnsFrom": ["message_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- },
- "work_versions_agent_id_agents_id_fk": {
- "name": "work_versions_agent_id_agents_id_fk",
- "tableFrom": "work_versions",
- "tableTo": "agents",
- "columnsFrom": ["agent_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.works": {
- "name": "works",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true
- },
- "type": {
- "name": "type",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "current_version_id": {
- "name": "current_version_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "resource_type": {
- "name": "resource_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "resource_id": {
- "name": "resource_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "tool_name": {
- "name": "tool_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "tool_identifier": {
- "name": "tool_identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "origin_topic_id": {
- "name": "origin_topic_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "origin_thread_id": {
- "name": "origin_thread_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "origin_agent_id": {
- "name": "origin_agent_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
- },
- "visibility": {
- "name": "visibility",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": false
- },
- "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()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "works_resource_user_scope_unique": {
- "name": "works_resource_user_scope_unique",
- "columns": [
- {
- "expression": "resource_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "resource_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "COALESCE((metadata -> 'agentShare' ->> 'topicId'), '')",
- "asc": true,
- "isExpression": true,
- "nulls": "last"
- }
- ],
- "isUnique": true,
- "where": "\"works\".\"workspace_id\" is null",
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "works_resource_workspace_scope_unique": {
- "name": "works_resource_workspace_scope_unique",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "resource_type",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
+ "name": "work_versions_work_id_tool_call_id_unique",
+ "columns": [
{
- "expression": "resource_id",
+ "expression": "work_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "COALESCE((metadata -> 'agentShare' ->> 'topicId'), '')",
+ "expression": "tool_call_id",
+ "isExpression": false,
"asc": true,
- "isExpression": true,
"nulls": "last"
}
],
"isUnique": true,
- "where": "\"works\".\"workspace_id\" is not null",
+ "where": "\"work_versions\".\"tool_call_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "works_user_id_idx": {
- "name": "works_user_id_idx",
+ "work_versions_thread_id_idx": {
+ "name": "work_versions_thread_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "thread_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47380,11 +51047,11 @@
"method": "btree",
"with": {}
},
- "works_workspace_id_idx": {
- "name": "works_workspace_id_idx",
+ "work_versions_message_id_idx": {
+ "name": "work_versions_message_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "message_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47395,23 +51062,11 @@
"method": "btree",
"with": {}
},
- "works_workspace_visibility_idx": {
- "name": "works_workspace_visibility_idx",
+ "work_versions_agent_id_idx": {
+ "name": "work_versions_agent_id_idx",
"columns": [
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "visibility",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "user_id",
+ "expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47422,97 +51077,65 @@
"method": "btree",
"with": {}
},
- "works_user_updated_at_id_idx": {
- "name": "works_user_updated_at_id_idx",
+ "work_versions_root_operation_created_at_idx": {
+ "name": "work_versions_root_operation_created_at_idx",
"columns": [
{
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "updated_at",
+ "expression": "root_operation_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"works\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "works_workspace_updated_at_id_idx": {
- "name": "works_workspace_updated_at_id_idx",
+ "work_versions_topic_created_at_idx": {
+ "name": "work_versions_topic_created_at_idx",
"columns": [
{
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "updated_at",
+ "expression": "topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
- "where": "\"works\".\"workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "works_origin_topic_id_idx": {
- "name": "works_origin_topic_id_idx",
+ "work_versions_topic_thread_created_at_idx": {
+ "name": "work_versions_topic_thread_created_at_idx",
"columns": [
{
- "expression": "origin_topic_id",
+ "expression": "topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "works_origin_thread_id_idx": {
- "name": "works_origin_thread_id_idx",
- "columns": [
+ },
{
- "expression": "origin_thread_id",
+ "expression": "thread_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "works_origin_agent_id_idx": {
- "name": "works_origin_agent_id_idx",
- "columns": [
+ },
{
- "expression": "origin_agent_id",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47525,49 +51148,49 @@
}
},
"foreignKeys": {
- "works_origin_topic_id_topics_id_fk": {
- "name": "works_origin_topic_id_topics_id_fk",
- "tableFrom": "works",
- "tableTo": "topics",
- "columnsFrom": ["origin_topic_id"],
+ "work_versions_work_id_works_id_fk": {
+ "name": "work_versions_work_id_works_id_fk",
+ "tableFrom": "work_versions",
+ "tableTo": "works",
+ "columnsFrom": ["work_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
},
- "works_origin_thread_id_threads_id_fk": {
- "name": "works_origin_thread_id_threads_id_fk",
- "tableFrom": "works",
- "tableTo": "threads",
- "columnsFrom": ["origin_thread_id"],
+ "work_versions_topic_id_topics_id_fk": {
+ "name": "work_versions_topic_id_topics_id_fk",
+ "tableFrom": "work_versions",
+ "tableTo": "topics",
+ "columnsFrom": ["topic_id"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "works_origin_agent_id_agents_id_fk": {
- "name": "works_origin_agent_id_agents_id_fk",
- "tableFrom": "works",
- "tableTo": "agents",
- "columnsFrom": ["origin_agent_id"],
+ "work_versions_thread_id_threads_id_fk": {
+ "name": "work_versions_thread_id_threads_id_fk",
+ "tableFrom": "work_versions",
+ "tableTo": "threads",
+ "columnsFrom": ["thread_id"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
- "works_user_id_users_id_fk": {
- "name": "works_user_id_users_id_fk",
- "tableFrom": "works",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "work_versions_message_id_messages_id_fk": {
+ "name": "work_versions_message_id_messages_id_fk",
+ "tableFrom": "work_versions",
+ "tableTo": "messages",
+ "columnsFrom": ["message_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "works_workspace_id_workspaces_id_fk": {
- "name": "works_workspace_id_workspaces_id_fk",
- "tableFrom": "works",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "work_versions_agent_id_agents_id_fk": {
+ "name": "work_versions_agent_id_agents_id_fk",
+ "tableFrom": "work_versions",
+ "tableTo": "agents",
+ "columnsFrom": ["agent_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
}
},
@@ -47577,8 +51200,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.workspace_audit_logs": {
- "name": "workspace_audit_logs",
+ "public.works": {
+ "name": "works",
"schema": "",
"columns": {
"id": {
@@ -47587,182 +51210,126 @@
"primaryKey": true,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "type": {
+ "name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
- "type": "text",
+ "current_version_id": {
+ "name": "current_version_id",
+ "type": "uuid",
"primaryKey": false,
"notNull": false
},
- "action": {
- "name": "action",
+ "resource_type": {
+ "name": "resource_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "resource_type": {
- "name": "resource_type",
+ "resource_id": {
+ "name": "resource_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "resource_id": {
- "name": "resource_id",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "metadata": {
- "name": "metadata",
- "type": "jsonb",
+ "description": {
+ "name": "description",
+ "type": "text",
"primaryKey": false,
- "notNull": false,
- "default": "'{}'::jsonb"
+ "notNull": false
},
- "ip_address": {
- "name": "ip_address",
+ "identifier": {
+ "name": "identifier",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
+ "status": {
+ "name": "status",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "workspace_audit_logs_workspace_id_idx": {
- "name": "workspace_audit_logs_workspace_id_idx",
- "columns": [
- {
- "expression": "workspace_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
+ "notNull": false
},
- "workspace_audit_logs_action_idx": {
- "name": "workspace_audit_logs_action_idx",
- "columns": [
- {
- "expression": "action",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
},
- "workspace_audit_logs_created_at_idx": {
- "name": "workspace_audit_logs_created_at_idx",
- "columns": [
- {
- "expression": "created_at",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- }
- },
- "foreignKeys": {
- "workspace_audit_logs_workspace_id_workspaces_id_fk": {
- "name": "workspace_audit_logs_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_audit_logs",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.workspace_invitations": {
- "name": "workspace_invitations",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
+ "tool_name": {
+ "name": "tool_name",
"type": "text",
- "primaryKey": true,
+ "primaryKey": false,
"notNull": true
},
- "workspace_id": {
- "name": "workspace_id",
+ "tool_identifier": {
+ "name": "tool_identifier",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "inviter_id": {
- "name": "inviter_id",
+ "origin_topic_id": {
+ "name": "origin_topic_id",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "email": {
- "name": "email",
+ "origin_thread_id": {
+ "name": "origin_thread_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "role": {
- "name": "role",
+ "origin_agent_id": {
+ "name": "origin_agent_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'member'"
+ "notNull": false
},
- "token": {
- "name": "token",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "status": {
- "name": "status",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
- "default": "'pending'"
+ "notNull": false
},
- "reusable": {
- "name": "reusable",
- "type": "boolean",
+ "visibility": {
+ "name": "visibility",
+ "type": "text",
"primaryKey": false,
- "notNull": true,
- "default": false
+ "notNull": true
},
- "expires_at": {
- "name": "expires_at",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "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",
@@ -47779,41 +51346,79 @@
}
},
"indexes": {
- "workspace_invitations_workspace_id_idx": {
- "name": "workspace_invitations_workspace_id_idx",
+ "works_resource_user_scope_unique": {
+ "name": "works_resource_user_scope_unique",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "resource_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "COALESCE((metadata -> 'agentShare' ->> 'topicId'), '')",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"works\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspace_invitations_inviter_id_idx": {
- "name": "workspace_invitations_inviter_id_idx",
+ "works_resource_workspace_scope_unique": {
+ "name": "works_resource_workspace_scope_unique",
"columns": [
{
- "expression": "inviter_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "resource_id",
"isExpression": false,
"asc": true,
"nulls": "last"
+ },
+ {
+ "expression": "COALESCE((metadata -> 'agentShare' ->> 'topicId'), '')",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"works\".\"workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspace_invitations_email_idx": {
- "name": "workspace_invitations_email_idx",
+ "works_user_id_idx": {
+ "name": "works_user_id_idx",
"columns": [
{
- "expression": "email",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47824,11 +51429,11 @@
"method": "btree",
"with": {}
},
- "workspace_invitations_token_idx": {
- "name": "workspace_invitations_token_idx",
+ "works_workspace_id_idx": {
+ "name": "works_workspace_id_idx",
"columns": [
{
- "expression": "token",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -47838,105 +51443,22 @@
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "workspace_invitations_workspace_id_workspaces_id_fk": {
- "name": "workspace_invitations_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_invitations",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "workspace_invitations_inviter_id_users_id_fk": {
- "name": "workspace_invitations_inviter_id_users_id_fk",
- "tableFrom": "workspace_invitations",
- "tableTo": "users",
- "columnsFrom": ["inviter_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {
- "workspace_invitations_token_unique": {
- "name": "workspace_invitations_token_unique",
- "nullsNotDistinct": false,
- "columns": ["token"]
- }
- },
- "policies": {},
- "checkConstraints": {
- "workspace_invitations_expiry_required": {
- "name": "workspace_invitations_expiry_required",
- "value": "\"workspace_invitations\".\"reusable\" OR \"workspace_invitations\".\"expires_at\" IS NOT NULL"
- }
- },
- "isRLSEnabled": false
- },
- "public.workspace_members": {
- "name": "workspace_members",
- "schema": "",
- "columns": {
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'member'"
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "responsibilities": {
- "name": "responsibilities",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "joined_at": {
- "name": "joined_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
},
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- }
- },
- "indexes": {
- "workspace_members_user_id_idx": {
- "name": "workspace_members_user_id_idx",
+ "works_workspace_visibility_idx": {
+ "name": "works_workspace_visibility_idx",
"columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "visibility",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
{
"expression": "user_id",
"isExpression": false,
@@ -47949,131 +51471,82 @@
"method": "btree",
"with": {}
},
- "workspace_members_unique_active_owner_idx": {
- "name": "workspace_members_unique_active_owner_idx",
+ "works_user_updated_at_id_idx": {
+ "name": "works_user_updated_at_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
- "where": "\"workspace_members\".\"role\" = 'owner' AND \"workspace_members\".\"deleted_at\" IS NULL",
+ "isUnique": false,
+ "where": "\"works\".\"workspace_id\" is null",
"concurrently": false,
"method": "btree",
"with": {}
- }
- },
- "foreignKeys": {
- "workspace_members_workspace_id_workspaces_id_fk": {
- "name": "workspace_members_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_members",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- },
- "workspace_members_user_id_users_id_fk": {
- "name": "workspace_members_user_id_users_id_fk",
- "tableFrom": "workspace_members",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
- "onDelete": "cascade",
- "onUpdate": "no action"
- }
- },
- "compositePrimaryKeys": {
- "workspace_members_workspace_id_user_id_pk": {
- "name": "workspace_members_workspace_id_user_id_pk",
- "columns": ["workspace_id", "user_id"]
- }
- },
- "uniqueConstraints": {},
- "policies": {},
- "checkConstraints": {},
- "isRLSEnabled": false
- },
- "public.workspace_team_members": {
- "name": "workspace_team_members",
- "schema": "",
- "columns": {
- "id": {
- "name": "id",
- "type": "uuid",
- "primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "team_id": {
- "name": "team_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "workspace_id": {
- "name": "workspace_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'member'"
},
- "created_at": {
- "name": "created_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- }
- },
- "indexes": {
- "workspace_team_members_team_user_unique": {
- "name": "workspace_team_members_team_user_unique",
+ "works_workspace_updated_at_id_idx": {
+ "name": "works_workspace_updated_at_id_idx",
"columns": [
{
- "expression": "team_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "user_id",
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
+ "where": "\"works\".\"workspace_id\" is not null",
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspace_team_members_workspace_user_idx": {
- "name": "workspace_team_members_workspace_user_idx",
+ "works_origin_topic_id_idx": {
+ "name": "works_origin_topic_id_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "origin_topic_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "works_origin_thread_id_idx": {
+ "name": "works_origin_thread_id_idx",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "origin_thread_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48084,11 +51557,11 @@
"method": "btree",
"with": {}
},
- "workspace_team_members_user_id_idx": {
- "name": "workspace_team_members_user_id_idx",
+ "works_origin_agent_id_idx": {
+ "name": "works_origin_agent_id_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "origin_agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48101,30 +51574,48 @@
}
},
"foreignKeys": {
- "workspace_team_members_workspace_id_workspaces_id_fk": {
- "name": "workspace_team_members_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_team_members",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "works_origin_topic_id_topics_id_fk": {
+ "name": "works_origin_topic_id_topics_id_fk",
+ "tableFrom": "works",
+ "tableTo": "topics",
+ "columnsFrom": ["origin_topic_id"],
"columnsTo": ["id"],
- "onDelete": "cascade",
+ "onDelete": "set null",
"onUpdate": "no action"
},
- "workspace_team_members_user_id_users_id_fk": {
- "name": "workspace_team_members_user_id_users_id_fk",
- "tableFrom": "workspace_team_members",
+ "works_origin_thread_id_threads_id_fk": {
+ "name": "works_origin_thread_id_threads_id_fk",
+ "tableFrom": "works",
+ "tableTo": "threads",
+ "columnsFrom": ["origin_thread_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "works_origin_agent_id_agents_id_fk": {
+ "name": "works_origin_agent_id_agents_id_fk",
+ "tableFrom": "works",
+ "tableTo": "agents",
+ "columnsFrom": ["origin_agent_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "works_user_id_users_id_fk": {
+ "name": "works_user_id_users_id_fk",
+ "tableFrom": "works",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "workspace_team_members_team_workspace_fk": {
- "name": "workspace_team_members_team_workspace_fk",
- "tableFrom": "workspace_team_members",
- "tableTo": "workspace_teams",
- "columnsFrom": ["team_id", "workspace_id"],
- "columnsTo": ["id", "workspace_id"],
+ "works_workspace_id_workspaces_id_fk": {
+ "name": "works_workspace_id_workspaces_id_fk",
+ "tableFrom": "works",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -48135,8 +51626,8 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.workspace_teams": {
- "name": "workspace_teams",
+ "public.workspace_audit_logs": {
+ "name": "workspace_audit_logs",
"schema": "",
"columns": {
"id": {
@@ -48151,32 +51642,39 @@
"primaryKey": false,
"notNull": true
},
- "name": {
- "name": "name",
- "type": "varchar(255)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "identifier": {
- "name": "identifier",
- "type": "varchar(16)",
+ "action": {
+ "name": "action",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "description": {
- "name": "description",
- "type": "varchar(1000)",
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
"primaryKey": false,
"notNull": false
},
- "avatar": {
- "name": "avatar",
+ "resource_id": {
+ "name": "resource_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "created_by": {
- "name": "created_by",
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "ip_address": {
+ "name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
@@ -48187,42 +51685,29 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "workspace_teams_workspace_identifier_unique": {
- "name": "workspace_teams_workspace_identifier_unique",
+ "workspace_audit_logs_workspace_id_idx": {
+ "name": "workspace_audit_logs_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
- {
- "expression": "identifier",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspace_teams_workspace_id_idx": {
- "name": "workspace_teams_workspace_id_idx",
+ "workspace_audit_logs_action_idx": {
+ "name": "workspace_audit_logs_action_idx",
"columns": [
{
- "expression": "workspace_id",
+ "expression": "action",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48233,11 +51718,11 @@
"method": "btree",
"with": {}
},
- "workspace_teams_created_by_idx": {
- "name": "workspace_teams_created_by_idx",
+ "workspace_audit_logs_created_at_idx": {
+ "name": "workspace_audit_logs_created_at_idx",
"columns": [
{
- "expression": "created_by",
+ "expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48250,47 +51735,31 @@
}
},
"foreignKeys": {
- "workspace_teams_workspace_id_workspaces_id_fk": {
- "name": "workspace_teams_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_teams",
+ "workspace_audit_logs_workspace_id_workspaces_id_fk": {
+ "name": "workspace_audit_logs_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_audit_logs",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
- },
- "workspace_teams_created_by_users_id_fk": {
- "name": "workspace_teams_created_by_users_id_fk",
- "tableFrom": "workspace_teams",
- "tableTo": "users",
- "columnsFrom": ["created_by"],
- "columnsTo": ["id"],
- "onDelete": "set null",
- "onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {
- "workspace_teams_id_workspace_unique": {
- "name": "workspace_teams_id_workspace_unique",
- "nullsNotDistinct": false,
- "columns": ["id", "workspace_id"]
- }
- },
+ "uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.workspace_user_settings": {
- "name": "workspace_user_settings",
+ "public.workspace_invitations": {
+ "name": "workspace_invitations",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
"workspace_id": {
"name": "workspace_id",
@@ -48298,18 +51767,50 @@
"primaryKey": false,
"notNull": true
},
- "user_id": {
- "name": "user_id",
+ "inviter_id": {
+ "name": "inviter_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "preference": {
- "name": "preference",
- "type": "jsonb",
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
"primaryKey": false,
"notNull": true,
- "default": "'{}'::jsonb"
+ "default": "'member'"
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "reusable": {
+ "name": "reusable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -48327,32 +51828,56 @@
}
},
"indexes": {
- "workspace_user_settings_workspace_id_user_id_unique": {
- "name": "workspace_user_settings_workspace_id_user_id_unique",
+ "workspace_invitations_workspace_id_idx": {
+ "name": "workspace_invitations_workspace_id_idx",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_invitations_inviter_id_idx": {
+ "name": "workspace_invitations_inviter_id_idx",
+ "columns": [
{
- "expression": "user_id",
+ "expression": "inviter_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspace_user_settings_user_id_idx": {
- "name": "workspace_user_settings_user_id_idx",
+ "workspace_invitations_email_idx": {
+ "name": "workspace_invitations_email_idx",
"columns": [
{
- "expression": "user_id",
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_invitations_token_idx": {
+ "name": "workspace_invitations_token_idx",
+ "columns": [
+ {
+ "expression": "token",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48365,99 +51890,86 @@
}
},
"foreignKeys": {
- "workspace_user_settings_workspace_id_workspaces_id_fk": {
- "name": "workspace_user_settings_workspace_id_workspaces_id_fk",
- "tableFrom": "workspace_user_settings",
+ "workspace_invitations_workspace_id_workspaces_id_fk": {
+ "name": "workspace_invitations_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_invitations",
"tableTo": "workspaces",
"columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "workspace_user_settings_user_id_users_id_fk": {
- "name": "workspace_user_settings_user_id_users_id_fk",
- "tableFrom": "workspace_user_settings",
+ "workspace_invitations_inviter_id_users_id_fk": {
+ "name": "workspace_invitations_inviter_id_users_id_fk",
+ "tableFrom": "workspace_invitations",
"tableTo": "users",
- "columnsFrom": ["user_id"],
+ "columnsFrom": ["inviter_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {},
+ "uniqueConstraints": {
+ "workspace_invitations_token_unique": {
+ "name": "workspace_invitations_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
"policies": {},
- "checkConstraints": {},
+ "checkConstraints": {
+ "workspace_invitations_expiry_required": {
+ "name": "workspace_invitations_expiry_required",
+ "value": "\"workspace_invitations\".\"reusable\" OR \"workspace_invitations\".\"expires_at\" IS NOT NULL"
+ }
+ },
"isRLSEnabled": false
},
- "public.workspaces": {
- "name": "workspaces",
+ "public.workspace_members": {
+ "name": "workspace_members",
"schema": "",
"columns": {
- "id": {
- "name": "id",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
- "primaryKey": true,
- "notNull": true
- },
- "slug": {
- "name": "slug",
- "type": "varchar(100)",
"primaryKey": false,
"notNull": true
},
- "name": {
- "name": "name",
- "type": "varchar(255)",
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
"primaryKey": false,
"notNull": true
},
- "description": {
- "name": "description",
- "type": "varchar(1000)",
+ "role": {
+ "name": "role",
+ "type": "text",
"primaryKey": false,
- "notNull": false
+ "notNull": true,
+ "default": "'member'"
},
- "avatar": {
- "name": "avatar",
+ "title": {
+ "name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "primary_owner_id": {
- "name": "primary_owner_id",
+ "responsibilities": {
+ "name": "responsibilities",
"type": "text",
"primaryKey": false,
- "notNull": true
+ "notNull": false
},
- "settings": {
- "name": "settings",
+ "config": {
+ "name": "config",
"type": "jsonb",
"primaryKey": false,
- "notNull": false,
+ "notNull": true,
"default": "'{}'::jsonb"
},
- "frozen": {
- "name": "frozen",
- "type": "boolean",
- "primaryKey": false,
- "notNull": false,
- "default": false
- },
- "frozen_reason": {
- "name": "frozen_reason",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "frozen_at": {
- "name": "frozen_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "created_at": {
- "name": "created_at",
+ "joined_at": {
+ "name": "joined_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
@@ -48469,59 +51981,80 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
}
},
"indexes": {
- "workspaces_slug_idx": {
- "name": "workspaces_slug_idx",
+ "workspace_members_user_id_idx": {
+ "name": "workspace_members_user_id_idx",
"columns": [
{
- "expression": "slug",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
- "workspaces_primary_owner_id_idx": {
- "name": "workspaces_primary_owner_id_idx",
+ "workspace_members_unique_active_owner_idx": {
+ "name": "workspace_members_unique_active_owner_idx",
"columns": [
{
- "expression": "primary_owner_id",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
+ "where": "\"workspace_members\".\"role\" = 'owner' AND \"workspace_members\".\"deleted_at\" IS NULL",
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "workspaces_primary_owner_id_users_id_fk": {
- "name": "workspaces_primary_owner_id_users_id_fk",
- "tableFrom": "workspaces",
+ "workspace_members_workspace_id_workspaces_id_fk": {
+ "name": "workspace_members_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_members",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_members_user_id_users_id_fk": {
+ "name": "workspace_members_user_id_users_id_fk",
+ "tableFrom": "workspace_members",
"tableTo": "users",
- "columnsFrom": ["primary_owner_id"],
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
- "compositePrimaryKeys": {},
+ "compositePrimaryKeys": {
+ "workspace_members_workspace_id_user_id_pk": {
+ "name": "workspace_members_workspace_id_user_id_pk",
+ "columns": ["workspace_id", "user_id"]
+ }
+ },
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.meetings": {
- "name": "meetings",
+ "public.workspace_team_members": {
+ "name": "workspace_team_members",
"schema": "",
"columns": {
"id": {
@@ -48531,8 +52064,8 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "user_id": {
- "name": "user_id",
+ "team_id": {
+ "name": "team_id",
"type": "text",
"primaryKey": false,
"notNull": true
@@ -48541,90 +52074,20 @@
"name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "title": {
- "name": "title",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'recording'"
- },
- "platform": {
- "name": "platform",
- "type": "text",
- "primaryKey": false,
- "notNull": true
- },
- "realtime_provider": {
- "name": "realtime_provider",
- "type": "text",
- "primaryKey": false,
"notNull": true
},
- "refine_provider": {
- "name": "refine_provider",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "language": {
- "name": "language",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "default": "'auto'"
- },
- "started_at": {
- "name": "started_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
- },
- "ended_at": {
- "name": "ended_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": false
- },
- "duration_ms": {
- "name": "duration_ms",
- "type": "integer",
- "primaryKey": false,
- "notNull": false
- },
- "audio_file_id": {
- "name": "audio_file_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "local_audio_path": {
- "name": "local_audio_path",
- "type": "text",
- "primaryKey": false,
- "notNull": false
- },
- "visibility": {
- "name": "visibility",
+ "role": {
+ "name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
- "default": "'private'"
- },
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "default": "'member'"
},
"created_at": {
"name": "created_at",
@@ -48632,45 +52095,32 @@
"primaryKey": false,
"notNull": true,
"default": "now()"
- },
- "updated_at": {
- "name": "updated_at",
- "type": "timestamp with time zone",
- "primaryKey": false,
- "notNull": true,
- "default": "now()"
}
},
"indexes": {
- "meetings_user_id_workspace_id_created_at_idx": {
- "name": "meetings_user_id_workspace_id_created_at_idx",
+ "workspace_team_members_team_user_unique": {
+ "name": "workspace_team_members_team_user_unique",
"columns": [
{
- "expression": "user_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "workspace_id",
+ "expression": "team_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "created_at",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": false,
+ "isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
},
- "meetings_workspace_id_created_at_idx": {
- "name": "meetings_workspace_id_created_at_idx",
+ "workspace_team_members_workspace_user_idx": {
+ "name": "workspace_team_members_workspace_user_idx",
"columns": [
{
"expression": "workspace_id",
@@ -48679,7 +52129,7 @@
"nulls": "last"
},
{
- "expression": "created_at",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48690,11 +52140,11 @@
"method": "btree",
"with": {}
},
- "meetings_audio_file_id_idx": {
- "name": "meetings_audio_file_id_idx",
+ "workspace_team_members_user_id_idx": {
+ "name": "workspace_team_members_user_id_idx",
"columns": [
{
- "expression": "audio_file_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48707,31 +52157,31 @@
}
},
"foreignKeys": {
- "meetings_user_id_users_id_fk": {
- "name": "meetings_user_id_users_id_fk",
- "tableFrom": "meetings",
- "tableTo": "users",
- "columnsFrom": ["user_id"],
+ "workspace_team_members_workspace_id_workspaces_id_fk": {
+ "name": "workspace_team_members_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_team_members",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "meetings_workspace_id_workspaces_id_fk": {
- "name": "meetings_workspace_id_workspaces_id_fk",
- "tableFrom": "meetings",
- "tableTo": "workspaces",
- "columnsFrom": ["workspace_id"],
+ "workspace_team_members_user_id_users_id_fk": {
+ "name": "workspace_team_members_user_id_users_id_fk",
+ "tableFrom": "workspace_team_members",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "meetings_audio_file_id_files_id_fk": {
- "name": "meetings_audio_file_id_files_id_fk",
- "tableFrom": "meetings",
- "tableTo": "files",
- "columnsFrom": ["audio_file_id"],
- "columnsTo": ["id"],
- "onDelete": "set null",
+ "workspace_team_members_team_workspace_fk": {
+ "name": "workspace_team_members_team_workspace_fk",
+ "tableFrom": "workspace_team_members",
+ "tableTo": "workspace_teams",
+ "columnsFrom": ["team_id", "workspace_id"],
+ "columnsTo": ["id", "workspace_id"],
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
@@ -48741,76 +52191,52 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.meeting_minutes": {
- "name": "meeting_minutes",
+ "public.workspace_teams": {
+ "name": "workspace_teams",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
- },
- "meeting_id": {
- "name": "meeting_id",
- "type": "uuid",
- "primaryKey": false,
"notNull": true
},
- "summary": {
- "name": "summary",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
- "notNull": false
- },
- "chapters": {
- "name": "chapters",
- "type": "jsonb",
- "primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": true
},
- "decisions": {
- "name": "decisions",
- "type": "jsonb",
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": true
},
- "action_items": {
- "name": "action_items",
- "type": "jsonb",
+ "identifier": {
+ "name": "identifier",
+ "type": "varchar(16)",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": true
},
- "keywords": {
- "name": "keywords",
- "type": "jsonb",
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
"primaryKey": false,
- "notNull": true,
- "default": "'[]'::jsonb"
+ "notNull": false
},
- "document_id": {
- "name": "document_id",
+ "avatar": {
+ "name": "avatar",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "model": {
- "name": "model",
+ "created_by": {
+ "name": "created_by",
"type": "text",
"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",
@@ -48827,11 +52253,17 @@
}
},
"indexes": {
- "meeting_minutes_meeting_id_unique": {
- "name": "meeting_minutes_meeting_id_unique",
+ "workspace_teams_workspace_identifier_unique": {
+ "name": "workspace_teams_workspace_identifier_unique",
"columns": [
{
- "expression": "meeting_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48842,11 +52274,26 @@
"method": "btree",
"with": {}
},
- "meeting_minutes_document_id_idx": {
- "name": "meeting_minutes_document_id_idx",
+ "workspace_teams_workspace_id_idx": {
+ "name": "workspace_teams_workspace_id_idx",
"columns": [
{
- "expression": "document_id",
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_teams_created_by_idx": {
+ "name": "workspace_teams_created_by_idx",
+ "columns": [
+ {
+ "expression": "created_by",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48859,33 +52306,39 @@
}
},
"foreignKeys": {
- "meeting_minutes_meeting_id_meetings_id_fk": {
- "name": "meeting_minutes_meeting_id_meetings_id_fk",
- "tableFrom": "meeting_minutes",
- "tableTo": "meetings",
- "columnsFrom": ["meeting_id"],
+ "workspace_teams_workspace_id_workspaces_id_fk": {
+ "name": "workspace_teams_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_teams",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "meeting_minutes_document_id_documents_id_fk": {
- "name": "meeting_minutes_document_id_documents_id_fk",
- "tableFrom": "meeting_minutes",
- "tableTo": "documents",
- "columnsFrom": ["document_id"],
+ "workspace_teams_created_by_users_id_fk": {
+ "name": "workspace_teams_created_by_users_id_fk",
+ "tableFrom": "workspace_teams",
+ "tableTo": "users",
+ "columnsFrom": ["created_by"],
"columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
- "uniqueConstraints": {},
+ "uniqueConstraints": {
+ "workspace_teams_id_workspace_unique": {
+ "name": "workspace_teams_id_workspace_unique",
+ "nullsNotDistinct": false,
+ "columns": ["id", "workspace_id"]
+ }
+ },
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.meeting_segments": {
- "name": "meeting_segments",
+ "public.workspace_user_settings": {
+ "name": "workspace_user_settings",
"schema": "",
"columns": {
"id": {
@@ -48895,54 +52348,24 @@
"notNull": true,
"default": "gen_random_uuid()"
},
- "meeting_id": {
- "name": "meeting_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": true
- },
- "speaker_id": {
- "name": "speaker_id",
- "type": "uuid",
- "primaryKey": false,
- "notNull": false
- },
- "source": {
- "name": "source",
+ "workspace_id": {
+ "name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "seq": {
- "name": "seq",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- },
- "start_ms": {
- "name": "start_ms",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- },
- "end_ms": {
- "name": "end_ms",
- "type": "integer",
- "primaryKey": false,
- "notNull": true
- },
- "text": {
- "name": "text",
+ "user_id": {
+ "name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "accessed_at": {
- "name": "accessed_at",
- "type": "timestamp with time zone",
+ "preference": {
+ "name": "preference",
+ "type": "jsonb",
"primaryKey": false,
"notNull": true,
- "default": "now()"
+ "default": "'{}'::jsonb"
},
"created_at": {
"name": "created_at",
@@ -48960,23 +52383,17 @@
}
},
"indexes": {
- "meeting_segments_meeting_id_source_seq_unique": {
- "name": "meeting_segments_meeting_id_source_seq_unique",
+ "workspace_user_settings_workspace_id_user_id_unique": {
+ "name": "workspace_user_settings_workspace_id_user_id_unique",
"columns": [
{
- "expression": "meeting_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "source",
+ "expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
- "expression": "seq",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -48987,38 +52404,11 @@
"method": "btree",
"with": {}
},
- "meeting_segments_meeting_id_source_start_ms_idx": {
- "name": "meeting_segments_meeting_id_source_start_ms_idx",
- "columns": [
- {
- "expression": "meeting_id",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "source",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- },
- {
- "expression": "start_ms",
- "isExpression": false,
- "asc": true,
- "nulls": "last"
- }
- ],
- "isUnique": false,
- "concurrently": false,
- "method": "btree",
- "with": {}
- },
- "meeting_segments_speaker_id_idx": {
- "name": "meeting_segments_speaker_id_idx",
+ "workspace_user_settings_user_id_idx": {
+ "name": "workspace_user_settings_user_id_idx",
"columns": [
{
- "expression": "speaker_id",
+ "expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
@@ -49031,22 +52421,22 @@
}
},
"foreignKeys": {
- "meeting_segments_meeting_id_meetings_id_fk": {
- "name": "meeting_segments_meeting_id_meetings_id_fk",
- "tableFrom": "meeting_segments",
- "tableTo": "meetings",
- "columnsFrom": ["meeting_id"],
+ "workspace_user_settings_workspace_id_workspaces_id_fk": {
+ "name": "workspace_user_settings_workspace_id_workspaces_id_fk",
+ "tableFrom": "workspace_user_settings",
+ "tableTo": "workspaces",
+ "columnsFrom": ["workspace_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
- "meeting_segments_speaker_id_meeting_speakers_id_fk": {
- "name": "meeting_segments_speaker_id_meeting_speakers_id_fk",
- "tableFrom": "meeting_segments",
- "tableTo": "meeting_speakers",
- "columnsFrom": ["speaker_id"],
+ "workspace_user_settings_user_id_users_id_fk": {
+ "name": "workspace_user_settings_user_id_users_id_fk",
+ "tableFrom": "workspace_user_settings",
+ "tableTo": "users",
+ "columnsFrom": ["user_id"],
"columnsTo": ["id"],
- "onDelete": "set null",
+ "onDelete": "cascade",
"onUpdate": "no action"
}
},
@@ -49056,41 +52446,71 @@
"checkConstraints": {},
"isRLSEnabled": false
},
- "public.meeting_speakers": {
- "name": "meeting_speakers",
+ "public.workspaces": {
+ "name": "workspaces",
"schema": "",
"columns": {
"id": {
"name": "id",
- "type": "uuid",
+ "type": "text",
"primaryKey": true,
- "notNull": true,
- "default": "gen_random_uuid()"
+ "notNull": true
},
- "meeting_id": {
- "name": "meeting_id",
- "type": "uuid",
+ "slug": {
+ "name": "slug",
+ "type": "varchar(100)",
"primaryKey": false,
"notNull": true
},
- "label": {
- "name": "label",
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "avatar": {
+ "name": "avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "primary_owner_id": {
+ "name": "primary_owner_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
- "display_name": {
- "name": "display_name",
+ "settings": {
+ "name": "settings",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "frozen": {
+ "name": "frozen",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "frozen_reason": {
+ "name": "frozen_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
- "accessed_at": {
- "name": "accessed_at",
+ "frozen_at": {
+ "name": "frozen_at",
"type": "timestamp with time zone",
"primaryKey": false,
- "notNull": true,
- "default": "now()"
+ "notNull": false
},
"created_at": {
"name": "created_at",
@@ -49108,34 +52528,43 @@
}
},
"indexes": {
- "meeting_speakers_meeting_id_label_unique": {
- "name": "meeting_speakers_meeting_id_label_unique",
+ "workspaces_slug_idx": {
+ "name": "workspaces_slug_idx",
"columns": [
{
- "expression": "meeting_id",
+ "expression": "slug",
"isExpression": false,
"asc": true,
"nulls": "last"
- },
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspaces_primary_owner_id_idx": {
+ "name": "workspaces_primary_owner_id_idx",
+ "columns": [
{
- "expression": "label",
+ "expression": "primary_owner_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
- "isUnique": true,
+ "isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
- "meeting_speakers_meeting_id_meetings_id_fk": {
- "name": "meeting_speakers_meeting_id_meetings_id_fk",
- "tableFrom": "meeting_speakers",
- "tableTo": "meetings",
- "columnsFrom": ["meeting_id"],
+ "workspaces_primary_owner_id_users_id_fk": {
+ "name": "workspaces_primary_owner_id_users_id_fk",
+ "tableFrom": "workspaces",
+ "tableTo": "users",
+ "columnsFrom": ["primary_owner_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
diff --git a/packages/database/migrations/meta/_journal.json b/packages/database/migrations/meta/_journal.json
index 4548938e425..05fe4f7b35b 100644
--- a/packages/database/migrations/meta/_journal.json
+++ b/packages/database/migrations/meta/_journal.json
@@ -1526,6 +1526,13 @@
"when": 1794843685342,
"tag": "0217_artboards",
"breakpoints": true
+ },
+ {
+ "idx": 218,
+ "version": "7",
+ "when": 1794852458535,
+ "tag": "0218_channel_and_contacts_schema",
+ "breakpoints": true
}
],
"version": "6"
diff --git a/packages/database/src/repositories/channel/README.md b/packages/database/src/repositories/channel/README.md
index 949bd47391e..151f7a078f4 100644
--- a/packages/database/src/repositories/channel/README.md
+++ b/packages/database/src/repositories/channel/README.md
@@ -155,9 +155,30 @@ individual messages are read in 12000-character chunks. Names and attachments re
External operation tokens receive `channel:read` only for a reserved Channel dispatch; ordinary
runs and sub-agents do not inherit it.
-Pending routing is part of member FIFO even before a job exists. An earlier main-channel
-decision blocks later claims until its recipients are known; an earlier Thread decision blocks
-only that Thread's following members. Skipped, failed or stopped routing releases this barrier.
+## Branch concurrency
+
+A member runs one reply per conversation branch (a Thread, or the main timeline) and answers each
+branch in message order; its branches run alongside each other. `candidates` returns one queue
+head per member and branch, and the coordinator settles and claims each branch without waiting on
+the member's others. A Thread starts only after the member's main-timeline answer to its root, so
+a follow-up never overtakes the reply it follows. A reply that opens a Thread before its claim
+runs in that Thread, which leaves the main timeline free for the next request.
+
+These locks are application rules in `claimJob`, not database constraints, so they can change
+without a migration. The branch lock is checked under the channel lock, which already serializes
+every claim of a member. The directory lock spans channels, so `claimJob` first takes a
+transaction-scoped advisory lock on the device directory, then looks for a live writer there; the
+plain index `channel_jobs_active_directory_idx` keeps that lookup cheap. Nothing else may set
+`writer_held`.
+
+Branches still share what a run touches. The directory lock stays per device directory: a second
+branch of the same member in a Channel-picked directory moves into its own worktree, as for
+another member. A member without a Channel device runs where the Agent's own settings say, like
+two ordinary conversations with that Agent.
+
+Pending routing is part of branch FIFO even before a job exists. An earlier undecided message in
+the same branch, or the Thread's undecided root, blocks later claims there until its recipients
+are known; other branches are not held. Skipped, failed or stopped routing releases this barrier.
A routed message's deferred follow-ups (`wake.afterMemberId`) are queued as `awaiting_primary`
and claimed only after the same message's primary responder job settles; a deferred claim freezes
the primary's published reply id in `manifest.primaryReplyMessageId`, read by
@@ -200,7 +221,7 @@ all-candidate fallback. Stopping a reply still fences it; root completion never
- Job status describes the Channel delivery; execution status/errors/usage live on its operation.
Operation completion is not proof that a device process ended. Only `releaseWriter` after
confirmed termination, or `retireReservation` for an untouched operation, releases the writer.
- Isolation frees the member but keeps the device/directory lock. Never retry an unknown delivery.
+ Isolation frees the member's branch but keeps the device/directory lock. Never retry an unknown delivery.
`retryJob` re-queues only a failed job whose device could not be reached
(`DeviceGatewayNotConfigured`), with its writer released and nothing accepted or published;
the next claim opens a fresh operation.
diff --git a/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts b/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
index 03704c7c014..2c34c2cffaf 100644
--- a/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
@@ -120,7 +120,7 @@ describe('asynchronous Channel routing', () => {
expect(await execution.claim(channel.id, job.id, lease)).not.toBeNull();
});
- it('waits for an earlier branch decision for a following Agent without blocking other channels', async () => {
+ it('waits for an earlier decision in its own branch only', async () => {
const { agent, asMember, channel, root } = await setup();
await execution.resolveRouting(channel.id, root.id, 1, {
memberIds: [agent.id],
@@ -136,14 +136,26 @@ describe('asynchronous Channel routing', () => {
requestKey: 'branch',
routing: 'decision',
});
- const next = await asMember.send(channel.id, {
+ // The main timeline is another branch: the Thread's pending decision never holds it.
+ const main = await asMember.send(channel.id, {
content: 'Later main',
mentions: [agent.id],
requestKey: 'main',
routing: 'fallback',
});
- const [job] = await jobsOf(db, next.id);
+ const [mainJob] = await jobsOf(db, main.id);
+ expect(await execution.claim(channel.id, mainJob.id, lease)).not.toBeNull();
+
+ const later = await asMember.send(channel.id, {
+ content: 'Later in the branch',
+ mentions: [agent.id],
+ requestKey: 'later',
+ routing: 'fallback',
+ threadId: branch.threadId,
+ });
+ const [job] = await jobsOf(db, later.id);
expect(await execution.claim(channel.id, job.id, lease)).toBeNull();
+ expect(await jobById(db, job.id)).toMatchObject({ blockedCode: 'member_busy' });
const otherChannel = await fixture.createTeamChannel('Unrelated');
const otherAgent = await fixture.addAgent(otherChannel.channel.id, 'Other channel Agent');
const unrelated = await otherChannel.asMember.send(otherChannel.channel.id, {
diff --git a/packages/database/src/repositories/channel/__tests__/execution.test.ts b/packages/database/src/repositories/channel/__tests__/execution.test.ts
index 2e7aad06e89..b302084691c 100644
--- a/packages/database/src/repositories/channel/__tests__/execution.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/execution.test.ts
@@ -212,7 +212,7 @@ describe('ChannelExecutionRepository', () => {
expect(await contents(threadJob.id)).toEqual(['thread-request']);
});
- it('answers in message order and holds one writer per member', async () => {
+ it('answers a branch in message order and holds one writer per member in it', async () => {
const { agent, asMember, channel, job } = await mentionAgent();
const next = await asMember.send(channel.id, {
content: 'Second',
@@ -234,6 +234,100 @@ describe('ChannelExecutionRepository', () => {
expect(await jobById(nextJob.id)).toMatchObject({ blockedCode: null });
});
+ /** A team channel with one Agent and a Thread per root title, each under a person's message. */
+ const threadsFor = async (config: Parameters<typeof fixture.addAgent>[2], titles: string[]) => {
+ const team = await fixture.createTeamChannel();
+ const agent = await fixture.addAgent(team.channel.id, 'Coder', config);
+ const threads = [];
+ for (const title of titles) {
+ const root = await team.asMember.send(team.channel.id, {
+ content: title,
+ mentions: [team.member.id],
+ requestKey: `root-${title}`,
+ routing: 'decision',
+ });
+ threads.push(await team.asMember.createThread(team.channel.id, { rootMessageId: root.id }));
+ }
+ let sent = 0;
+ const ask = async (threadId: string | null) => {
+ sent += 1;
+ const message = await team.asMember.send(team.channel.id, {
+ content: `Request ${sent}`,
+ mentions: [agent.id],
+ requestKey: `ask-${sent}`,
+ routing: 'decision',
+ ...(threadId && { threadId }),
+ });
+ const [job] = await jobsOf(db, message.id);
+ return job;
+ };
+ return { ...team, agent, ask, threads };
+ };
+
+ it('runs one member in several branches at once, each in message order', async () => {
+ const { ask, channel, threads } = await threadsFor(nativeConfig, ['A', 'B']);
+ const [threadA, threadB] = threads;
+ const a1 = await ask(threadA.id);
+ const a2 = await ask(threadA.id);
+ const b1 = await ask(threadB.id);
+ const main = await ask(null);
+
+ // One queue head per branch, so a busy Thread never hides another branch's request.
+ const { heads } = await execution.candidates(channel.id);
+ expect(heads.map((job) => job.id).sort()).toEqual([a1.id, b1.id, main.id].sort());
+
+ expect(await execution.claim(channel.id, a1.id, lease)).not.toBeNull();
+ expect(await execution.claim(channel.id, a2.id, lease)).toBeNull();
+ expect(await jobById(a2.id)).toMatchObject({ blockedCode: 'member_busy' });
+ expect(await execution.claim(channel.id, b1.id, lease)).not.toBeNull();
+ expect(await execution.claim(channel.id, main.id, lease)).not.toBeNull();
+
+ expect(await execution.retireReservation(channel.id, a1.id)).toBe(true);
+ expect(await execution.claim(channel.id, a2.id, lease)).not.toBeNull();
+ });
+
+ it("keeps a device directory exclusive across a member's branches", async () => {
+ const { ask, channel, threads } = await threadsFor(deviceConfig(), ['A', 'B']);
+ const first = await ask(threads[0].id);
+ const second = await ask(threads[1].id);
+
+ expect(await execution.claim(channel.id, first.id, lease)).not.toBeNull();
+ expect(await execution.claim(channel.id, second.id, lease)).toBeNull();
+ expect(await jobById(second.id)).toMatchObject({ blockedCode: 'directory_locked' });
+ // Which lets the waiting Thread move into its own worktree instead.
+ expect(await execution.worktreeCandidate(channel.id, second.id)).toMatchObject({
+ sourceDirectory: '/repo',
+ threadId: threads[1].id,
+ });
+ });
+
+ it("starts a Thread only after the member's answer to its root", async () => {
+ const {
+ agent,
+ asMember,
+ channel,
+ job: rootJob,
+ message: root,
+ } = await mentionAgent(nativeConfig);
+ const thread = await asMember.createThread(channel.id, { rootMessageId: root.id });
+ const message = await asMember.send(channel.id, {
+ content: 'And this',
+ mentions: [agent.id],
+ requestKey: 'in-thread',
+ routing: 'decision',
+ threadId: thread.id,
+ });
+ const [threadJob] = await jobsOf(db, message.id);
+
+ expect(await execution.claim(channel.id, threadJob.id, lease)).toBeNull();
+ expect(await jobById(threadJob.id)).toMatchObject({ blockedCode: 'member_busy' });
+ expect(await execution.claim(channel.id, rootJob.id, lease)).not.toBeNull();
+ expect(await execution.claim(channel.id, threadJob.id, lease)).toBeNull();
+
+ expect(await execution.retireReservation(channel.id, rootJob.id)).toBe(true);
+ expect(await execution.claim(channel.id, threadJob.id, lease)).not.toBeNull();
+ });
+
it('claims independent Agents concurrently while keeping a shared directory exclusive', async () => {
const { asMember, channel } = await fixture.createTeamChannel();
const first = await fixture.addAgent(channel.id, 'First', deviceConfig());
diff --git a/packages/database/src/repositories/channel/claim.ts b/packages/database/src/repositories/channel/claim.ts
index 5d1680dc795..668ed96824e 100644
--- a/packages/database/src/repositories/channel/claim.ts
+++ b/packages/database/src/repositories/channel/claim.ts
@@ -9,13 +9,10 @@ import {
channelMemberGrants,
channelMembers,
channelMessages,
- channelThreads,
devices,
} from '../../schemas';
import type { Transaction } from '../../type';
import { createNanoId } from '../../utils/idGenerator';
-import { notTrashed } from '../../utils/softDelete';
-import { uniqueViolationConstraint } from '../../utils/uniqueViolation';
import { resolveExecutionConfig } from './agent';
import { AWAITING_PRIMARY_REASON, findThread } from './delivery';
import { buildManifest } from './manifest';
@@ -70,7 +67,9 @@ export interface ChannelClaim {
topic: TopicItem;
}
-const DIRECTORY_LOCK = 'channel_jobs_active_directory_unique';
+/** Jobs in the same conversation branch: one Thread, or the main timeline. */
+export const sameBranch = (threadId: string | null) =>
+ threadId ? eq(channelJobs.threadId, threadId) : isNull(channelJobs.threadId);
/**
* Records why a queued job cannot start; clients read the code, never the text. A job waiting
@@ -160,7 +159,10 @@ const deviceBlock = async (
return { code: 'unavailable', reason: 'The device owner did not allow this environment' };
};
-/** Another live writer in the same device directory, from any channel or member. */
+/**
+ * Another live writer in the same device directory, from any channel or member. Holds the
+ * directory's advisory lock until the claim commits, so two claims never both take it.
+ */
const directoryBlock = async (
tx: Transaction,
deviceId: string | undefined,
@@ -168,6 +170,11 @@ const directoryBlock = async (
): Promise<Block | undefined> => {
if (!deviceId || !workingDirectory) return;
+ // Claims in other channels race for the same directory, and no channel lock covers them:
+ // this lock orders them, so the read below sees a writer the other claim just committed.
+ await tx.execute(
+ sql`SELECT pg_advisory_xact_lock(hashtext(${`channel-directory:${JSON.stringify([deviceId, workingDirectory])}`}))`,
+ );
const [busy] = await tx
.select({ id: channelJobs.id })
.from(channelJobs)
@@ -272,24 +279,23 @@ export const claimJob = async (
.select()
.from(channelMessages)
.where(eq(channelMessages.id, job.messageId));
- // An earlier undecided message may still enqueue this member. Checking only jobs
- // would let an explicit follow-up overtake it while another worker routes it.
+ // An earlier undecided message in this branch may still enqueue this member ahead of it, and
+ // so may the Thread's root while it is undecided. Checking only jobs would let a later
+ // request overtake it while another worker routes it. Other branches never hold this one.
const [pendingRoute] = await tx
.select({ id: channelMessages.id })
.from(channelMessages)
- .leftJoin(channelThreads, eq(channelThreads.id, channelMessages.threadId))
.where(
and(
eq(channelMessages.channelId, channel.id),
eq(channelMessages.routingStatus, 'pending'),
lt(channelMessages.sequence, request.sequence),
- or(
- isNull(channelMessages.threadId),
- and(
- notTrashed(channelThreads.isDeleted),
- sql`${channelThreads.followerMemberIds} @> ${JSON.stringify([job.memberId])}::jsonb`,
- ),
- ),
+ job.threadId
+ ? or(
+ eq(channelMessages.threadId, job.threadId),
+ thread ? eq(channelMessages.id, thread.rootMessageId) : undefined,
+ )
+ : isNull(channelMessages.threadId),
),
)
.limit(1);
@@ -298,12 +304,18 @@ export const claimJob = async (
return null;
}
- // Each member answers in message order.
+ // Each member answers a branch in message order; its other branches run alongside.
const [head] = await tx
.select({ id: channelJobs.id })
.from(channelJobs)
.innerJoin(channelMessages, eq(channelMessages.id, channelJobs.messageId))
- .where(and(eq(channelJobs.memberId, job.memberId), eq(channelJobs.status, 'queued')))
+ .where(
+ and(
+ eq(channelJobs.memberId, job.memberId),
+ eq(channelJobs.status, 'queued'),
+ sameBranch(job.threadId),
+ ),
+ )
.orderBy(asc(channelMessages.sequence), asc(channelJobs.createdAt))
.limit(1);
if (head?.id !== job.id) {
@@ -311,6 +323,29 @@ export const claimJob = async (
return null;
}
+ // A Thread follows its root: the member answers the root on the main timeline first.
+ const [rootReply] = thread
+ ? await tx
+ .select({ id: channelJobs.id })
+ .from(channelJobs)
+ .where(
+ and(
+ eq(channelJobs.memberId, job.memberId),
+ eq(channelJobs.messageId, thread.rootMessageId),
+ isNull(channelJobs.threadId),
+ or(
+ eq(channelJobs.status, 'queued'),
+ and(eq(channelJobs.writerHeld, true), isNull(channelJobs.isolatedAt)),
+ ),
+ ),
+ )
+ .limit(1)
+ : [];
+ if (rootReply) {
+ await block(tx, job, 'member_busy', 'Waiting for an earlier reply from this Agent');
+ return null;
+ }
+
const [member] = await tx
.select()
.from(channelMembers)
@@ -325,6 +360,7 @@ export const claimJob = async (
eq(channelJobs.memberId, member.id),
eq(channelJobs.writerHeld, true),
isNull(channelJobs.isolatedAt),
+ sameBranch(job.threadId),
),
)
.limit(1);
@@ -426,70 +462,57 @@ export const claimJob = async (
}
const now = new Date();
- let claimed: Omit<ChannelClaim, 'member'>;
- try {
- // A savepoint, so losing the directory race to another channel keeps this transaction
- // and leaves no topic or operation behind.
- claimed = await tx.transaction(async (savepoint) => {
- const topic = await resolveTopic(
- savepoint,
- channel,
- job,
- member,
- scope,
- request.sequence,
- executionConfig,
- );
- const manifest = buildManifest({
- job,
- member,
- primaryReplyMessageId: primary?.publishedMessageId ?? undefined,
- request,
- thread,
- });
- // Same shape as ordinary runs (`op_{ts}_{agentId}_{topicId}_{rand}`): trace storage
- // derives the Agent and topic from the operation ID.
- const operationId = `op_${Date.now()}_${member.agentId}_${topic.id}_${createNanoId(8)()}`;
- await savepoint.insert(agentOperations).values({
- id: operationId,
- userId: scope.userId,
- workspaceId: scope.workspaceId,
- topicId: topic.id,
- agentId: member.agentId,
- trigger: 'channel',
- status: 'idle',
- model: executionConfig.model,
- provider: executionConfig.provider,
- });
- const [updated] = await savepoint
- .update(channelJobs)
- .set({
- claimedAt: sql`clock_timestamp()`,
- blockedCode: null,
- blockedReason: null,
- // Only a device picked in the Channel; a wait marker from `block` must not linger.
- deviceId: member.config!.deviceId ?? null,
- executionConfig,
- leaseExpiresAt: new Date(now.getTime() + options.leaseMs),
- leaseOwner: options.leaseOwner,
- manifest,
- operationId,
- topicId: topic.id,
- status: 'running',
- workingDirectory: executionConfig.workingDirectory,
- writerHeld: true,
- })
- .where(eq(channelJobs.id, job.id))
- .returning();
- return { job: updated, topic };
- });
- } catch (error) {
- const constraint = uniqueViolationConstraint(error);
- if (constraint === undefined) throw error;
- if (constraint === DIRECTORY_LOCK)
- await block(tx, job, 'directory_locked', 'Another run is using this directory');
- return null;
- }
+ const topic = await resolveTopic(
+ tx,
+ channel,
+ job,
+ member,
+ scope,
+ request.sequence,
+ executionConfig,
+ );
+ const manifest = buildManifest({
+ job,
+ member,
+ primaryReplyMessageId: primary?.publishedMessageId ?? undefined,
+ request,
+ thread,
+ });
+ // Same shape as ordinary runs (`op_{ts}_{agentId}_{topicId}_{rand}`): trace storage
+ // derives the Agent and topic from the operation ID.
+ const operationId = `op_${Date.now()}_${member.agentId}_${topic.id}_${createNanoId(8)()}`;
+ await tx.insert(agentOperations).values({
+ id: operationId,
+ userId: scope.userId,
+ workspaceId: scope.workspaceId,
+ topicId: topic.id,
+ agentId: member.agentId,
+ trigger: 'channel',
+ status: 'idle',
+ model: executionConfig.model,
+ provider: executionConfig.provider,
+ });
+ const [updated] = await tx
+ .update(channelJobs)
+ .set({
+ claimedAt: sql`clock_timestamp()`,
+ blockedCode: null,
+ blockedReason: null,
+ // Only a device picked in the Channel; a wait marker from `block` must not linger.
+ deviceId: member.config!.deviceId ?? null,
+ executionConfig,
+ leaseExpiresAt: new Date(now.getTime() + options.leaseMs),
+ leaseOwner: options.leaseOwner,
+ manifest,
+ operationId,
+ topicId: topic.id,
+ status: 'running',
+ workingDirectory: executionConfig.workingDirectory,
+ writerHeld: true,
+ })
+ .where(eq(channelJobs.id, job.id))
+ .returning();
+ const claimed = { job: updated, topic };
await audit(tx, channel.id, 'run_claimed', job.id, {
cutoff: claimed.job.manifest!.cutoffSequence,
diff --git a/packages/database/src/repositories/channel/execution.ts b/packages/database/src/repositories/channel/execution.ts
index eb9f4c25121..0673794ad24 100644
--- a/packages/database/src/repositories/channel/execution.ts
+++ b/packages/database/src/repositories/channel/execution.ts
@@ -191,8 +191,9 @@ export class ChannelExecutionRepository {
/**
* What one advance pass works on: in-flight jobs to settle, oldest first and bounded, and
- * the queue head of each member. Only a head can be claimed, so a member whose backlog is
- * blocked (offline device, pending approval) cannot crowd out the other members.
+ * the queue head of each member in each branch (a Thread, or the main timeline). Only a head
+ * can be claimed, so a member whose backlog is blocked (offline device, pending approval)
+ * cannot crowd out the other members, and one busy branch never holds back another.
*/
candidates = async (channelId: string, limit = 100) => {
const [inFlight, heads] = await Promise.all([
@@ -211,12 +212,17 @@ export class ChannelExecutionRepository {
.orderBy(asc(channelJobs.createdAt))
.limit(limit),
this.db
- .selectDistinctOn([channelJobs.memberId], { job: channelJobs })
+ .selectDistinctOn([channelJobs.memberId, channelJobs.threadId], { job: channelJobs })
.from(channelJobs)
.innerJoin(channelMessages, eq(channelMessages.id, channelJobs.messageId))
.where(and(eq(channelJobs.channelId, channelId), eq(channelJobs.status, 'queued')))
// Same order as the head check in claimJob.
- .orderBy(channelJobs.memberId, asc(channelMessages.sequence), asc(channelJobs.createdAt)),
+ .orderBy(
+ channelJobs.memberId,
+ channelJobs.threadId,
+ asc(channelMessages.sequence),
+ asc(channelJobs.createdAt),
+ ),
]);
return {
heads: heads
diff --git a/packages/database/src/schemas/__tests__/channel.test.ts b/packages/database/src/schemas/__tests__/channel.test.ts
index 97fc91af273..263592db4b5 100644
--- a/packages/database/src/schemas/__tests__/channel.test.ts
+++ b/packages/database/src/schemas/__tests__/channel.test.ts
@@ -336,7 +336,6 @@ describe('channel schema', () => {
{ userId: 'missing-user' },
{ userId: null, agentId: 'missing-agent', routingStatus: 'reply' as const },
{ userId: ownerId, agentId: first.agent.agentId },
- { userId: null, agentId: first.agent.agentId },
{ userId: ownerId, routingStatus: 'reply' as const },
]) {
await expect(
@@ -351,6 +350,25 @@ describe('channel schema', () => {
}
});
+ it('accepts a request an Agent wrote', async () => {
+ const first = await createChannel('First');
+ const message = await createMessage(first.channel.id, first.owner.id, 1);
+
+ const [request] = await serverDB
+ .insert(channelMessages)
+ .values({
+ ...message,
+ agentId: first.agent.agentId,
+ id: undefined,
+ requestKey: 'agent-request',
+ sequence: 2,
+ userId: null,
+ })
+ .returning();
+ expect(request).toMatchObject({ agentId: first.agent.agentId, userId: null });
+ expect(request.routingStatus).not.toBe('reply');
+ });
+
it('keeps Channel attachments unique and drops them with the file', async () => {
const first = await createChannel('First');
const message = await createMessage(first.channel.id, first.owner.id, 1);
@@ -382,53 +400,15 @@ describe('channel schema', () => {
});
describe('writer locks', () => {
- it('allows one writer per member until it is released or isolated', async () => {
- const fixture = await createChannel();
- const [job] = await createClaimedJob(fixture, 1, null);
-
- await expect(createClaimedJob(fixture, 2, null)).rejects.toThrow();
-
- await serverDB
- .update(channelJobs)
- .set({ isolatedAt: new Date() })
- .where(eq(channelJobs.id, job.id));
- await expect(createClaimedJob(fixture, 3, null)).resolves.toHaveLength(1);
- });
-
- it('serializes writers on one device directory across channels', async () => {
+ // One writer per member and branch, and per device directory, are application rules
+ // checked by `claimJob` (see the repository's execution tests), not database constraints.
+ it('leaves writer exclusivity to the application', async () => {
const first = await createChannel('First');
const second = await createChannel('Second');
- const [job] = await createClaimedJob(first, 1);
-
- await expect(createClaimedJob(second, 1)).rejects.toThrow();
- await expect(
- createClaimedJob(second, 2, { deviceId: 'device-1', workingDirectory: '/other' }),
- ).resolves.toHaveLength(1);
+ await createClaimedJob(first, 1);
- await serverDB
- .update(channelJobs)
- .set({ writerHeld: false })
- .where(eq(channelJobs.id, job.id));
- const third = await createChannel('Third');
- await expect(createClaimedJob(third, 1)).resolves.toHaveLength(1);
- });
-
- it('keeps the directory locked while an isolated writer is still unconfirmed', async () => {
- const first = await createChannel('First');
- const second = await createChannel('Second');
- const [job] = await createClaimedJob(first, 1);
-
- await serverDB
- .update(channelJobs)
- .set({ isolatedAt: new Date() })
- .where(eq(channelJobs.id, job.id));
- await expect(createClaimedJob(second, 1)).rejects.toThrow();
-
- await serverDB
- .update(channelJobs)
- .set({ writerHeld: false })
- .where(eq(channelJobs.id, job.id));
- await expect(createClaimedJob(second, 2)).resolves.toHaveLength(1);
+ await expect(createClaimedJob(first, 2)).resolves.toHaveLength(1);
+ await expect(createClaimedJob(second, 1)).resolves.toHaveLength(1);
});
});
diff --git a/packages/database/src/schemas/channel.ts b/packages/database/src/schemas/channel.ts
index a15c615fc83..3c588c1b51c 100644
--- a/packages/database/src/schemas/channel.ts
+++ b/packages/database/src/schemas/channel.ts
@@ -88,6 +88,12 @@ export const channels = pgTable(
* is kept by the application, which serializes opening it.
*/
peerUserId: text('peer_user_id').references(() => users.id, { onDelete: 'cascade' }),
+ /**
+ * The two Agents of a conversation between Agents (`agentA:agentB`, sorted), opened when one
+ * of `userId`'s Agents asks another. `userId` is its owner member and the execution identity
+ * of both Agents; it watches the exchange without being part of it.
+ */
+ agentPairKey: text('agent_pair_key'),
title: text('title').notNull(),
/** Last allocated message sequence; incremented under the row lock when a message lands. */
@@ -115,6 +121,10 @@ export const channels = pgTable(
uniqueIndex('channels_direct_unique')
.on(t.agentId, t.userId, sql`coalesce(${t.workspaceId}, '')`)
.where(sql`${t.agentId} IS NOT NULL`),
+ // One conversation per Agent pair, person and scope, like the direct conversation.
+ uniqueIndex('channels_agent_pair_unique')
+ .on(t.agentPairKey, t.userId, sql`coalesce(${t.workspaceId}, '')`)
+ .where(sql`${t.agentPairKey} IS NOT NULL`),
check(
'channels_direct_visibility_check',
sql`${t.agentId} IS NULL OR ${t.visibility} = 'private'`,
@@ -147,6 +157,8 @@ export const channelMembers = pgTable(
role: text('role').$type<ChannelMemberRole>(),
/** Highest sequence this person has read in the main channel. */
lastReadSequence: integer('last_read_sequence'),
+ /** When this person pinned the conversation atop their own list; NULL when not pinned. */
+ pinnedAt: timestamptz('pinned_at'),
// Agent members
/** NULL after Agent deletion; keep membership and authored history. */
@@ -315,7 +327,10 @@ export const channelMessages = pgTable(
content: text('content').notNull(),
/** Actual human sender, not the owner/requester of an Agent reply. */
userId: text('user_id').references(() => users.id, { onDelete: 'set null' }),
- /** Actual Agent sender. Author deletion retains group history and clears its reference. */
+ /**
+ * Actual Agent sender: of a reply, or of a request one Agent sent another in their
+ * conversation. Author deletion retains group history and clears its reference.
+ */
agentId: text('agent_id').references(() => agents.id, { onDelete: 'set null' }),
/** Mentioned member ids. Mentioned Agents run; mentioned people are only notified. */
mentions: jsonb('mentions').$type<string[]>().notNull().default([]),
@@ -363,10 +378,6 @@ export const channelMessages = pgTable(
'channel_messages_user_sender_check',
sql`${t.routingStatus} <> 'reply' OR ${t.userId} IS NULL`,
),
- check(
- 'channel_messages_agent_sender_check',
- sql`${t.routingStatus} = 'reply' OR ${t.agentId} IS NULL`,
- ),
],
);
@@ -454,7 +465,7 @@ export const channelJobs = pgTable(
/**
* Set when termination could not be confirmed in time (INC-049). Publication is revoked so
* the member may run again, though not in the same device directory until the stop is
- * confirmed: isolation frees the member lock but never `writerHeld`.
+ * confirmed: isolation frees the member's branch but never `writerHeld`.
*/
isolatedAt: timestamptz('isolated_at'),
/** Final answer saved by the run; immutable once set. */
@@ -481,20 +492,14 @@ export const channelJobs = pgTable(
index('channel_jobs_lease_expires_idx')
.on(t.leaseExpiresAt)
.where(sql`${t.writerHeld} AND ${t.isolatedAt} IS NULL`),
- /** At most one writer per member. */
- uniqueIndex('channel_jobs_active_member_unique')
- .on(t.memberId)
- .where(sql`${t.writerHeld} AND ${t.isolatedAt} IS NULL`),
/**
- * At most one writer per device directory, across all channels. Unlike the member lock,
- * isolation does not release it: only physical stop confirmation proves the old process
- * has left the directory.
+ * Live writers by device directory. The locks themselves are application rules checked in
+ * `claimJob` (one writer per member and branch under the channel lock, one per device
+ * directory under an advisory lock), not database constraints, so they can change freely.
*/
- uniqueIndex('channel_jobs_active_directory_unique')
+ index('channel_jobs_active_directory_idx')
.on(t.deviceId, t.workingDirectory)
- .where(
- sql`${t.deviceId} IS NOT NULL AND ${t.workingDirectory} IS NOT NULL AND ${t.writerHeld}`,
- ),
+ .where(sql`${t.writerHeld}`),
foreignKey({
columns: [t.channelId, t.memberId],
foreignColumns: [channelMembers.channelId, channelMembers.id],
diff --git a/packages/database/src/schemas/contact.ts b/packages/database/src/schemas/contact.ts
index 6afb2b6ef59..8f06585a17f 100644
--- a/packages/database/src/schemas/contact.ts
+++ b/packages/database/src/schemas/contact.ts
@@ -14,10 +14,13 @@ import {
import { timestamps, timestamptz } from './_helpers';
import { agents } from './agent';
import { users } from './user';
+import { workspaces } from './workspace';
/**
- * One entry in a person's address book. Address books are personal: they are not scoped to a
- * workspace, and every read pins `user_id`.
+ * One entry in an address book. People are personal: their entries pin `user_id` and appear in
+ * every scope. An `agent` entry belongs to the scope it was added in: with no `workspace_id` it
+ * is its owner's alone; with one it is the workspace's, shown to every member there, and
+ * `user_id` only records who added it.
*
* A `user` entry exists only for an accepted contact request, and always in both directions.
* An `agent` entry is another person's Agent added through its share link. It references the
@@ -40,6 +43,9 @@ export const userContacts = pgTable(
.references(() => users.id, { onDelete: 'cascade' })
.notNull(),
+ /** Only on `agent` entries: the workspace whose address book holds it; null is personal. */
+ workspaceId: text('workspace_id').references(() => workspaces.id, { onDelete: 'cascade' }),
+
type: text('type').$type<ContactType>().notNull(),
contactUserId: text('contact_user_id').references(() => users.id, { onDelete: 'cascade' }),
agentId: text('agent_id').references(() => agents.id, { onDelete: 'cascade' }),
@@ -60,7 +66,10 @@ export const userContacts = pgTable(
.where(sql`${t.contactUserId} IS NOT NULL`),
uniqueIndex('user_contacts_agent_unique')
.on(t.userId, t.agentId)
- .where(sql`${t.agentId} IS NOT NULL`),
+ .where(sql`${t.agentId} IS NOT NULL AND ${t.workspaceId} IS NULL`),
+ uniqueIndex('user_contacts_workspace_agent_unique')
+ .on(t.workspaceId, t.agentId)
+ .where(sql`${t.agentId} IS NOT NULL AND ${t.workspaceId} IS NOT NULL`),
// Neither partial index serves the cascades from users and agents.
index('user_contacts_contact_user_id_idx').on(t.contactUserId),
index('user_contacts_agent_id_idx').on(t.agentId),