🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🗃️ feat(database): add per-person channel sidebar sections (#23283)
Arvin Xu0ad6212c2bea
diff --git a/docs/development/database-schema.dbml b/docs/development/database-schema.dbmlindex 6d90e3bea83..fa216273a5c 100644--- a/docs/development/database-schema.dbml+++ b/docs/development/database-schema.dbml@@ -1644,6 +1644,9 @@ table channel_members {user_id textrole textlast_read_sequence integer+ section_id uuid+ pinned boolean [not null, default: false]+ hidden boolean [not null, default: false]pinned_at "timestamp with time zone"agent_id textname text@@ -1658,6 +1661,7 @@ table channel_members {(channel_id, id) [name: 'channel_members_scope_unique', unique](channel_id, user_id) [name: 'channel_members_channel_user_unique', unique]user_id [name: 'channel_members_user_id_idx']+ section_id [name: 'channel_members_section_id_idx']agent_id [name: 'channel_members_agent_id_idx']@@ -1666,6 +1670,7 @@ table channel_members {+}}@@ -1713,6 +1718,21 @@ table channel_messages {}}+table channel_sections {+ id uuid [pk, not null, default: `gen_random_uuid()`]+ user_id text [not null]+ workspace_id text+ name text [not null]+ sort integer+ collapsed boolean [not null, default: false]+ created_at "timestamp with time zone" [not null, default: `now()`]+ updated_at "timestamp with time zone" [not null, default: `now()`]++ indexes {+ (user_id, workspace_id) [name: 'channel_sections_user_id_workspace_id_idx']+ }+}+table channel_threads {id text [pk, not null]channel_id text [not null]diff --git a/packages/database/migrations/0220_channel_sections.sql b/packages/database/migrations/0220_channel_sections.sqlnew file mode 100644index 00000000000..d450fd7ffd2--- /dev/null+++ b/packages/database/migrations/0220_channel_sections.sql@@ -0,0 +1,24 @@+CREATE TABLE IF NOT EXISTS "channel_sections" (+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,+ "user_id" text NOT NULL,+ "workspace_id" text,+ "name" text NOT NULL,+ "sort" integer,+ "collapsed" boolean DEFAULT false NOT NULL,+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL+);+--> statement-breakpoint+ALTER TABLE "channel_members" ADD COLUMN IF NOT EXISTS "section_id" uuid;--> statement-breakpoint+ALTER TABLE "channel_members" ADD COLUMN IF NOT EXISTS "pinned" boolean DEFAULT false NOT NULL;--> statement-breakpoint+ALTER TABLE "channel_members" ADD COLUMN IF NOT EXISTS "hidden" boolean DEFAULT false NOT NULL;--> statement-breakpoint+ALTER TABLE "channel_sections" DROP CONSTRAINT IF EXISTS "channel_sections_user_id_users_id_fk";--> statement-breakpoint+ALTER TABLE "channel_sections" ADD CONSTRAINT "channel_sections_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+ALTER TABLE "channel_sections" DROP CONSTRAINT IF EXISTS "channel_sections_workspace_id_workspaces_id_fk";--> statement-breakpoint+ALTER TABLE "channel_sections" ADD CONSTRAINT "channel_sections_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "channel_sections_user_id_workspace_id_idx" ON "channel_sections" USING btree ("user_id","workspace_id");--> statement-breakpoint+ALTER TABLE "channel_members" DROP CONSTRAINT IF EXISTS "channel_members_section_id_channel_sections_id_fk";--> statement-breakpoint+ALTER TABLE "channel_members" ADD CONSTRAINT "channel_members_section_id_channel_sections_id_fk" FOREIGN KEY ("section_id") REFERENCES "public"."channel_sections"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint+CREATE INDEX IF NOT EXISTS "channel_members_section_id_idx" ON "channel_members" USING btree ("section_id") WHERE "channel_members"."section_id" IS NOT NULL;--> statement-breakpoint+ALTER TABLE "channel_members" DROP CONSTRAINT IF EXISTS "channel_members_section_id_owner_check";--> statement-breakpoint+ALTER TABLE "channel_members" ADD CONSTRAINT "channel_members_section_id_owner_check" CHECK ("channel_members"."section_id" IS NULL OR "channel_members"."actor_type" = 'user');\ No newline at end of filediff --git a/packages/database/migrations/meta/0210_snapshot.json b/packages/database/migrations/meta/0220_snapshot.jsonsimilarity index 92%rename from packages/database/migrations/meta/0210_snapshot.jsonrename to packages/database/migrations/meta/0220_snapshot.jsonindex e915ca8cab7..19f7db035f0 100644--- a/packages/database/migrations/meta/0210_snapshot.json+++ b/packages/database/migrations/meta/0220_snapshot.json@@ -1,6 +1,6 @@{- "id": "cde6aca7-5edb-4f76-9a5c-e9a8d7f3721e",- "prevId": "c1058806-e910-4f65-99ad-9f434bc92441",+ "id": "77cad3c6-892d-4bc9-a657-a554d6ebb0a6",+ "prevId": "f353e57e-aad8-4a85-81e3-07fad5564c60","version": "7","dialect": "postgresql","tables": {@@ -112,6 +112,12 @@"primaryKey": false,"notNull": false},+ "review_mark_id": {+ "name": "review_mark_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },"client_id": {"name": "client_id","type": "text",@@ -280,6 +286,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": {@@ -374,6 +395,19 @@"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",@@ -785,6 +819,478 @@"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": "",@@ -11075,8 +11581,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.async_tasks": {- "name": "async_tasks",+ "public.artboard_boards": {+ "name": "artboard_boards","schema": "","columns": {"id": {@@ -11086,27 +11592,27 @@"notNull": true,"default": "gen_random_uuid()"},- "type": {- "name": "type",+ "artboard_id": {+ "name": "artboard_id","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "status": {- "name": "status",+ "page_id": {+ "name": "page_id","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "error": {- "name": "error",- "type": "jsonb",+ "group_id": {+ "name": "group_id",+ "type": "text","primaryKey": false,"notNull": false},- "inference_id": {- "name": "inference_id",- "type": "text",+ "round_id": {+ "name": "round_id",+ "type": "uuid","primaryKey": false,"notNull": false},@@ -11122,24 +11628,71 @@"primaryKey": false,"notNull": false},- "duration": {- "name": "duration",- "type": "integer",+ "project_id": {+ "name": "project_id",+ "type": "text","primaryKey": false,"notNull": false},- "parent_id": {- "name": "parent_id",+ "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+ },+ "expected": {+ "name": "expected",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "rect": {+ "name": "rect",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "source_work_version_id": {+ "name": "source_work_version_id","type": "uuid","primaryKey": false,"notNull": false},+ "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": true,- "default": "'{}'"+ "notNull": false},"accessed_at": {"name": "accessed_at",@@ -11164,11 +11717,11 @@}},"indexes": {- "async_tasks_user_id_idx": {- "name": "async_tasks_user_id_idx",+ "artboard_boards_artboard_id_idx": {+ "name": "artboard_boards_artboard_id_idx","columns": [{- "expression": "user_id",+ "expression": "artboard_id","isExpression": false,"asc": true,"nulls": "last"@@ -11179,11 +11732,11 @@"method": "btree","with": {}},- "async_tasks_parent_id_idx": {- "name": "async_tasks_parent_id_idx",+ "artboard_boards_page_id_idx": {+ "name": "artboard_boards_page_id_idx","columns": [{- "expression": "parent_id",+ "expression": "page_id","isExpression": false,"asc": true,"nulls": "last"@@ -11194,59 +11747,103 @@"method": "btree","with": {}},- "async_tasks_type_status_idx": {- "name": "async_tasks_type_status_idx",+ "artboard_boards_group_id_idx": {+ "name": "artboard_boards_group_id_idx","columns": [{- "expression": "type",+ "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": "status",+ "expression": "round_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": false,+ "where": "\"artboard_boards\".\"round_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "async_tasks_inference_id_idx": {- "name": "async_tasks_inference_id_idx",+ "artboard_boards_project_id_idx": {+ "name": "artboard_boards_project_id_idx","columns": [{- "expression": "inference_id",+ "expression": "project_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": false,+ "where": "\"artboard_boards\".\"project_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "async_tasks_metadata_idx": {- "name": "async_tasks_metadata_idx",+ "artboard_boards_acceptance_flow_node_id_unique": {+ "name": "artboard_boards_acceptance_flow_node_id_unique","columns": [{- "expression": "metadata",+ "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": "gin",+ "method": "btree","with": {}},- "async_tasks_workspace_id_idx": {- "name": "async_tasks_workspace_id_idx",+ "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",@@ -11256,15 +11853,68 @@}],"isUnique": false,+ "where": "\"artboard_boards\".\"workspace_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_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"@@ -11275,9 +11925,9 @@"onDelete": "cascade","onUpdate": "no action"},- "async_tasks_workspace_id_workspaces_id_fk": {- "name": "async_tasks_workspace_id_workspaces_id_fk",- "tableFrom": "async_tasks",+ "artboard_boards_workspace_id_workspaces_id_fk": {+ "name": "artboard_boards_workspace_id_workspaces_id_fk",+ "tableFrom": "artboard_boards","tableTo": "workspaces","columnsFrom": ["workspace_id"@@ -11287,214 +11937,209 @@],"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": {},+ "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.accounts": {- "name": "accounts",+ "public.artboard_comments": {+ "name": "artboard_comments","schema": "","columns": {- "access_token": {- "name": "access_token",- "type": "text",- "primaryKey": false,- "notNull": false- },- "access_token_expires_at": {- "name": "access_token_expires_at",- "type": "timestamp",- "primaryKey": false,- "notNull": false+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"},- "account_id": {- "name": "account_id",+ "artboard_id": {+ "name": "artboard_id","type": "text","primaryKey": false,"notNull": true},- "created_at": {- "name": "created_at",- "type": "timestamp",+ "parent_comment_id": {+ "name": "parent_comment_id",+ "type": "uuid","primaryKey": false,- "notNull": true,- "default": "now()"- },- "id": {- "name": "id",- "type": "text",- "primaryKey": true,- "notNull": true+ "notNull": false},- "id_token": {- "name": "id_token",+ "author_user_id": {+ "name": "author_user_id","type": "text","primaryKey": false,"notNull": false},- "password": {- "name": "password",+ "author_agent_id": {+ "name": "author_agent_id","type": "text","primaryKey": false,"notNull": false},- "provider_id": {- "name": "provider_id",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "refresh_token": {- "name": "refresh_token",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "refresh_token_expires_at": {- "name": "refresh_token_expires_at",- "type": "timestamp",+ "page_id": {+ "name": "page_id",+ "type": "text","primaryKey": false,"notNull": false},- "scope": {- "name": "scope",+ "group_id": {+ "name": "group_id","type": "text","primaryKey": false,"notNull": false},- "updated_at": {- "name": "updated_at",- "type": "timestamp",+ "board_id": {+ "name": "board_id",+ "type": "uuid","primaryKey": false,- "notNull": true+ "notNull": false},- "user_id": {- "name": "user_id",+ "content": {+ "name": "content","type": "text","primaryKey": false,"notNull": true- }- },- "indexes": {- "account_userId_idx": {- "name": "account_userId_idx",- "columns": [- {- "expression": "user_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- }- },- "foreignKeys": {- "accounts_user_id_users_id_fk": {- "name": "accounts_user_id_users_id_fk",- "tableFrom": "accounts",- "tableTo": "users",- "columnsFrom": [- "user_id"- ],- "columnsTo": [- "id"- ],- "onDelete": "cascade",- "onUpdate": "no action"- }- },- "compositePrimaryKeys": {},- "uniqueConstraints": {},- "policies": {},- "checkConstraints": {},- "isRLSEnabled": false- },- "public.passkey": {- "name": "passkey",- "schema": "",- "columns": {- "aaguid": {- "name": "aaguid",+ },+ "client_id": {+ "name": "client_id","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "backedUp": {- "name": "backedUp",- "type": "boolean",+ "anchor": {+ "name": "anchor",+ "type": "jsonb","primaryKey": false,"notNull": false},- "counter": {- "name": "counter",- "type": "integer",+ "delivered_at": {+ "name": "delivered_at",+ "type": "timestamp with time zone","primaryKey": false,"notNull": false},- "createdAt": {- "name": "createdAt",- "type": "timestamp",- "primaryKey": false,- "notNull": false,- "default": "now()"- },- "credentialID": {- "name": "credentialID",- "type": "text",+ "resolved_at": {+ "name": "resolved_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": false},- "deviceType": {- "name": "deviceType",+ "resolved_by_user_id": {+ "name": "resolved_by_user_id","type": "text","primaryKey": false,"notNull": false},- "id": {- "name": "id",- "type": "text",- "primaryKey": true,- "notNull": true- },- "name": {- "name": "name",- "type": "text",+ "metadata": {+ "name": "metadata",+ "type": "jsonb","primaryKey": false,"notNull": false},- "publicKey": {- "name": "publicKey",- "type": "text",+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": true,+ "default": "now()"},- "transports": {- "name": "transports",- "type": "text",+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},- "userId": {- "name": "userId",- "type": "text",+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": true,+ "default": "now()"}},"indexes": {- "passkey_credential_id_unique": {- "name": "passkey_credential_id_unique",+ "artboard_comments_artboard_id_author_user_id_client_id_unique": {+ "name": "artboard_comments_artboard_id_author_user_id_client_id_unique","columns": [{- "expression": "credentialID",+ "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"@@ -11505,11 +12150,17 @@"method": "btree","with": {}},- "passkey_user_id_idx": {- "name": "passkey_user_id_idx",+ "artboard_comments_artboard_id_created_at_idx": {+ "name": "artboard_comments_artboard_id_created_at_idx","columns": [{- "expression": "userId",+ "expression": "artboard_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at","isExpression": false,"asc": true,"nulls": "last"@@ -11519,95 +12170,27 @@"concurrently": false,"method": "btree","with": {}- }- },- "foreignKeys": {- "passkey_userId_users_id_fk": {- "name": "passkey_userId_users_id_fk",- "tableFrom": "passkey",- "tableTo": "users",- "columnsFrom": [- "userId"- ],- "columnsTo": [- "id"- ],- "onDelete": "cascade",- "onUpdate": "no action"- }- },- "compositePrimaryKeys": {},- "uniqueConstraints": {},- "policies": {},- "checkConstraints": {},- "isRLSEnabled": false- },- "public.auth_sessions": {- "name": "auth_sessions",- "schema": "",- "columns": {- "created_at": {- "name": "created_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true,- "default": "now()"- },- "expires_at": {- "name": "expires_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true- },- "id": {- "name": "id",- "type": "text",- "primaryKey": true,- "notNull": true- },- "impersonated_by": {- "name": "impersonated_by",- "type": "text",- "primaryKey": false,- "notNull": false- },- "ip_address": {- "name": "ip_address",- "type": "text",- "primaryKey": false,- "notNull": false- },- "token": {- "name": "token",- "type": "text",- "primaryKey": false,- "notNull": true- },- "updated_at": {- "name": "updated_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true},- "user_agent": {- "name": "user_agent",- "type": "text",- "primaryKey": false,- "notNull": false+ "artboard_comments_parent_comment_id_idx": {+ "name": "artboard_comments_parent_comment_id_idx",+ "columns": [+ {+ "expression": "parent_comment_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}},- "user_id": {- "name": "user_id",- "type": "text",- "primaryKey": false,- "notNull": true- }- },- "indexes": {- "auth_session_userId_idx": {- "name": "auth_session_userId_idx",+ "artboard_comments_board_id_idx": {+ "name": "artboard_comments_board_id_idx","columns": [{- "expression": "user_id",+ "expression": "board_id","isExpression": false,"asc": true,"nulls": "last"@@ -11617,72 +12200,43 @@"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+ "artboard_comments_user_id_idx": {+ "name": "artboard_comments_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}},- "secret": {- "name": "secret",- "type": "text",- "primaryKey": false,- "notNull": true+ "artboard_comments_workspace_id_idx": {+ "name": "artboard_comments_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"artboard_comments\".\"workspace_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}},- "user_id": {- "name": "user_id",- "type": "text",- "primaryKey": false,- "notNull": true- }- },- "indexes": {- "two_factor_secret_idx": {- "name": "two_factor_secret_idx",+ "artboard_comments_page_id_idx": {+ "name": "artboard_comments_page_id_idx","columns": [{- "expression": "secret",+ "expression": "page_id","isExpression": false,"asc": true,"nulls": "last"@@ -11693,26 +12247,79 @@"method": "btree","with": {}},- "two_factor_user_id_idx": {- "name": "two_factor_user_id_idx",+ "artboard_comments_group_id_idx": {+ "name": "artboard_comments_group_id_idx","columns": [{- "expression": "user_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": {- "two_factor_user_id_users_id_fk": {- "name": "two_factor_user_id_users_id_fk",- "tableFrom": "two_factor",+ "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"@@ -11722,83 +12329,81 @@],"onDelete": "cascade","onUpdate": "no action"- }- },- "compositePrimaryKeys": {},- "uniqueConstraints": {},- "policies": {},- "checkConstraints": {},- "isRLSEnabled": false- },- "public.verifications": {- "name": "verifications",- "schema": "",- "columns": {- "created_at": {- "name": "created_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true,- "default": "now()"},- "expires_at": {- "name": "expires_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true+ "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"},- "id": {- "name": "id",- "type": "text",- "primaryKey": true,- "notNull": true+ "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"},- "identifier": {- "name": "identifier",- "type": "text",- "primaryKey": false,- "notNull": true+ "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"},- "updated_at": {- "name": "updated_at",- "type": "timestamp",- "primaryKey": false,- "notNull": true,- "default": "now()"+ "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"},- "value": {- "name": "value",- "type": "text",- "primaryKey": false,- "notNull": true- }- },- "indexes": {- "verification_identifier_idx": {- "name": "verification_identifier_idx",- "columns": [- {- "expression": "identifier",- "isExpression": false,- "asc": true,- "nulls": "last"- }+ "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"],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"}},- "foreignKeys": {},"compositePrimaryKeys": {},"uniqueConstraints": {},"policies": {},"checkConstraints": {},"isRLSEnabled": false},- "public.channel_audit": {- "name": "channel_audit",+ "public.artboard_edges": {+ "name": "artboard_edges","schema": "","columns": {"id": {@@ -11808,30 +12413,81 @@"notNull": true,"default": "gen_random_uuid()"},- "channel_id": {- "name": "channel_id",+ "artboard_id": {+ "name": "artboard_id","type": "text","primaryKey": false,"notNull": true},- "event": {- "name": "event",- "type": "text",+ "source_board_id": {+ "name": "source_board_id",+ "type": "uuid","primaryKey": false,"notNull": true},- "target_id": {- "name": "target_id",+ "target_board_id": {+ "name": "target_board_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "details": {- "name": "details",+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "acceptance_flow_edge_id": {+ "name": "acceptance_flow_edge_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "label": {+ "name": "label",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "''"+ },+ "condition": {+ "name": "condition",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "is_default": {+ "name": "is_default",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "sort_order": {+ "name": "sort_order",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "metadata": {+ "name": "metadata","type": "jsonb","primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,"notNull": true,- "default": "'{}'::jsonb"+ "default": "now()"},"created_at": {"name": "created_at",@@ -11839,26 +12495,67 @@"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_edges_artboard_id_idx": {+ "name": "artboard_edges_artboard_id_idx","columns": [{- "expression": "channel_id",+ "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": "event",+ "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": "created_at",+ "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"@@ -11869,41 +12566,113 @@"method": "btree","with": {}},- "channel_audit_target_event_idx": {- "name": "channel_audit_target_event_idx",+ "artboard_edges_acceptance_flow_edge_id_unique": {+ "name": "artboard_edges_acceptance_flow_edge_id_unique","columns": [{- "expression": "target_id",+ "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": "event",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"- },+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboard_edges_workspace_id_idx": {+ "name": "artboard_edges_workspace_id_idx",+ "columns": [{- "expression": "created_at",+ "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": {- "channel_audit_channel_id_channels_id_fk": {- "name": "channel_audit_channel_id_channels_id_fk",- "tableFrom": "channel_audit",- "tableTo": "channels",+ "artboard_edges_artboard_id_artboards_id_fk": {+ "name": "artboard_edges_artboard_id_artboards_id_fk",+ "tableFrom": "artboard_edges",+ "tableTo": "artboards","columnsFrom": [- "channel_id"+ "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"@@ -11918,191 +12687,2996 @@"checkConstraints": {},"isRLSEnabled": false},- "public.channel_jobs": {- "name": "channel_jobs",+ "public.artboard_groups": {+ "name": "artboard_groups","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,+ "primaryKey": true,"notNull": true},- "message_id": {- "name": "message_id",- "type": "uuid",+ "artboard_id": {+ "name": "artboard_id",+ "type": "text","primaryKey": false,"notNull": true},- "thread_id": {- "name": "thread_id",+ "page_id": {+ "name": "page_id","type": "text","primaryKey": false,- "notNull": false- },- "requester_member_id": {- "name": "requester_member_id",- "type": "uuid",- "primaryKey": false,"notNull": true},- "status": {- "name": "status",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,- "notNull": true,- "default": "'queued'"+ "notNull": true},- "blocked_reason": {- "name": "blocked_reason",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "blocked_code": {- "name": "blocked_code",+ "kind": {+ "name": "kind","type": "text","primaryKey": false,- "notNull": false- },- "claimed_at": {- "name": "claimed_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false+ "notNull": true},- "topic_id": {- "name": "topic_id",+ "title": {+ "name": "title","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "operation_id": {- "name": "operation_id",+ "description": {+ "name": "description","type": "text","primaryKey": false,"notNull": false},- "wake": {- "name": "wake",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "manifest": {- "name": "manifest",+ "rect": {+ "name": "rect","type": "jsonb","primaryKey": false,- "notNull": false+ "notNull": true},- "execution_config": {- "name": "execution_config",+ "metadata": {+ "name": "metadata","type": "jsonb","primaryKey": false,"notNull": false},- "device_id": {- "name": "device_id",- "type": "varchar(64)",- "primaryKey": false,- "notNull": false- },- "working_directory": {- "name": "working_directory",- "type": "text",- "primaryKey": false,- "notNull": false- },- "accepted_at": {- "name": "accepted_at",+ "accessed_at": {+ "name": "accessed_at","type": "timestamp with time zone","primaryKey": false,- "notNull": false- },- "lease_owner": {- "name": "lease_owner",- "type": "text",- "primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},- "lease_expires_at": {- "name": "lease_expires_at",+ "created_at": {+ "name": "created_at","type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},- "writer_held": {- "name": "writer_held",- "type": "boolean",+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone","primaryKey": false,"notNull": true,- "default": false+ "default": "now()"+ }+ },+ "indexes": {+ "artboard_groups_artboard_id_idx": {+ "name": "artboard_groups_artboard_id_idx",+ "columns": [+ {+ "expression": "artboard_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboard_groups_page_id_idx": {+ "name": "artboard_groups_page_id_idx",+ "columns": [+ {+ "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": {+ "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": [+ "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"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.artboard_pages": {+ "name": "artboard_pages",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "artboard_id": {+ "name": "artboard_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+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "sort_order": {+ "name": "sort_order",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "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_pages_artboard_id_idx": {+ "name": "artboard_pages_artboard_id_idx",+ "columns": [+ {+ "expression": "artboard_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboard_pages_user_id_idx": {+ "name": "artboard_pages_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "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": {+ "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": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.artboard_rounds": {+ "name": "artboard_rounds",+ "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+ },+ "page_id": {+ "name": "page_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+ },+ "title": {+ "name": "title",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'open'"+ },+ "recommended_board_id": {+ "name": "recommended_board_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "chosen_board_id": {+ "name": "chosen_board_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "selected_by": {+ "name": "selected_by",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "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": "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_rounds_artboard_id_idx": {+ "name": "artboard_rounds_artboard_id_idx",+ "columns": [+ {+ "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": "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": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboard_rounds_workspace_id_idx": {+ "name": "artboard_rounds_workspace_id_idx",+ "columns": [+ {+ "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": "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": "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": {+ "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": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.artboards": {+ "name": "artboards",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "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+ },+ "topic_id": {+ "name": "topic_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "task_id": {+ "name": "task_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "project_id": {+ "name": "project_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "acceptance_id": {+ "name": "acceptance_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "title": {+ "name": "title",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "content": {+ "name": "content",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "phase": {+ "name": "phase",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'discuss'"+ },+ "revision": {+ "name": "revision",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 1+ },+ "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": {+ "artboards_user_id_idx": {+ "name": "artboards_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_workspace_id_idx": {+ "name": "artboards_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"artboards\".\"workspace_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_topic_id_idx": {+ "name": "artboards_topic_id_idx",+ "columns": [+ {+ "expression": "topic_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"artboards\".\"topic_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_task_id_idx": {+ "name": "artboards_task_id_idx",+ "columns": [+ {+ "expression": "task_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"artboards\".\"task_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_project_id_idx": {+ "name": "artboards_project_id_idx",+ "columns": [+ {+ "expression": "project_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_phase_idx": {+ "name": "artboards_phase_idx",+ "columns": [+ {+ "expression": "phase",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_created_at_idx": {+ "name": "artboards_created_at_idx",+ "columns": [+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "artboards_updated_at_idx": {+ "name": "artboards_updated_at_idx",+ "columns": [+ {+ "expression": "updated_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "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"+ },+ "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"+ },+ "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"+ },+ "artboards_project_id_projects_id_fk": {+ "name": "artboards_project_id_projects_id_fk",+ "tableFrom": "artboards",+ "tableTo": "projects",+ "columnsFrom": [+ "project_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "artboards_acceptance_id_acceptances_id_fk": {+ "name": "artboards_acceptance_id_acceptances_id_fk",+ "tableFrom": "artboards",+ "tableTo": "acceptances",+ "columnsFrom": [+ "acceptance_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.async_tasks": {+ "name": "async_tasks",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "error": {+ "name": "error",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "inference_id": {+ "name": "inference_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "duration": {+ "name": "duration",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "parent_id": {+ "name": "parent_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'"+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "async_tasks_user_id_idx": {+ "name": "async_tasks_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "async_tasks_parent_id_idx": {+ "name": "async_tasks_parent_id_idx",+ "columns": [+ {+ "expression": "parent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "async_tasks_type_status_idx": {+ "name": "async_tasks_type_status_idx",+ "columns": [+ {+ "expression": "type",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "async_tasks_inference_id_idx": {+ "name": "async_tasks_inference_id_idx",+ "columns": [+ {+ "expression": "inference_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "async_tasks_metadata_idx": {+ "name": "async_tasks_metadata_idx",+ "columns": [+ {+ "expression": "metadata",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "gin",+ "with": {}+ },+ "async_tasks_workspace_id_idx": {+ "name": "async_tasks_workspace_id_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "async_tasks_user_id_users_id_fk": {+ "name": "async_tasks_user_id_users_id_fk",+ "tableFrom": "async_tasks",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "async_tasks_workspace_id_workspaces_id_fk": {+ "name": "async_tasks_workspace_id_workspaces_id_fk",+ "tableFrom": "async_tasks",+ "tableTo": "workspaces",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.accounts": {+ "name": "accounts",+ "schema": "",+ "columns": {+ "access_token": {+ "name": "access_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "access_token_expires_at": {+ "name": "access_token_expires_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": false+ },+ "account_id": {+ "name": "account_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "id_token": {+ "name": "id_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "password": {+ "name": "password",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "provider_id": {+ "name": "provider_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "refresh_token": {+ "name": "refresh_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "refresh_token_expires_at": {+ "name": "refresh_token_expires_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": false+ },+ "scope": {+ "name": "scope",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ }+ },+ "indexes": {+ "account_userId_idx": {+ "name": "account_userId_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "accounts_user_id_users_id_fk": {+ "name": "accounts_user_id_users_id_fk",+ "tableFrom": "accounts",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.passkey": {+ "name": "passkey",+ "schema": "",+ "columns": {+ "aaguid": {+ "name": "aaguid",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "backedUp": {+ "name": "backedUp",+ "type": "boolean",+ "primaryKey": false,+ "notNull": false+ },+ "counter": {+ "name": "counter",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "createdAt": {+ "name": "createdAt",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": false,+ "default": "now()"+ },+ "credentialID": {+ "name": "credentialID",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "deviceType": {+ "name": "deviceType",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "publicKey": {+ "name": "publicKey",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "transports": {+ "name": "transports",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "userId": {+ "name": "userId",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ }+ },+ "indexes": {+ "passkey_credential_id_unique": {+ "name": "passkey_credential_id_unique",+ "columns": [+ {+ "expression": "credentialID",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "passkey_user_id_idx": {+ "name": "passkey_user_id_idx",+ "columns": [+ {+ "expression": "userId",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "passkey_userId_users_id_fk": {+ "name": "passkey_userId_users_id_fk",+ "tableFrom": "passkey",+ "tableTo": "users",+ "columnsFrom": [+ "userId"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.auth_sessions": {+ "name": "auth_sessions",+ "schema": "",+ "columns": {+ "created_at": {+ "name": "created_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "expires_at": {+ "name": "expires_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true+ },+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "impersonated_by": {+ "name": "impersonated_by",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "ip_address": {+ "name": "ip_address",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "token": {+ "name": "token",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true+ },+ "user_agent": {+ "name": "user_agent",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ }+ },+ "indexes": {+ "auth_session_userId_idx": {+ "name": "auth_session_userId_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "auth_sessions_user_id_users_id_fk": {+ "name": "auth_sessions_user_id_users_id_fk",+ "tableFrom": "auth_sessions",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {+ "auth_sessions_token_unique": {+ "name": "auth_sessions_token_unique",+ "nullsNotDistinct": false,+ "columns": [+ "token"+ ]+ }+ },+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.two_factor": {+ "name": "two_factor",+ "schema": "",+ "columns": {+ "backup_codes": {+ "name": "backup_codes",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "secret": {+ "name": "secret",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ }+ },+ "indexes": {+ "two_factor_secret_idx": {+ "name": "two_factor_secret_idx",+ "columns": [+ {+ "expression": "secret",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "two_factor_user_id_idx": {+ "name": "two_factor_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "two_factor_user_id_users_id_fk": {+ "name": "two_factor_user_id_users_id_fk",+ "tableFrom": "two_factor",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.verifications": {+ "name": "verifications",+ "schema": "",+ "columns": {+ "created_at": {+ "name": "created_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "expires_at": {+ "name": "expires_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true+ },+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "identifier": {+ "name": "identifier",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ }+ },+ "indexes": {+ "verification_identifier_idx": {+ "name": "verification_identifier_idx",+ "columns": [+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_audit": {+ "name": "channel_audit",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "channel_id": {+ "name": "channel_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "event": {+ "name": "event",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "target_id": {+ "name": "target_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "details": {+ "name": "details",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'::jsonb"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "channel_audit_channel_event_idx": {+ "name": "channel_audit_channel_event_idx",+ "columns": [+ {+ "expression": "channel_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "event",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_audit_target_event_idx": {+ "name": "channel_audit_target_event_idx",+ "columns": [+ {+ "expression": "target_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "event",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "channel_audit_channel_id_channels_id_fk": {+ "name": "channel_audit_channel_id_channels_id_fk",+ "tableFrom": "channel_audit",+ "tableTo": "channels",+ "columnsFrom": [+ "channel_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_jobs": {+ "name": "channel_jobs",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "channel_id": {+ "name": "channel_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "member_id": {+ "name": "member_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "message_id": {+ "name": "message_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "thread_id": {+ "name": "thread_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "requester_member_id": {+ "name": "requester_member_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'queued'"+ },+ "blocked_reason": {+ "name": "blocked_reason",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "blocked_code": {+ "name": "blocked_code",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "claimed_at": {+ "name": "claimed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "topic_id": {+ "name": "topic_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "operation_id": {+ "name": "operation_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "wake": {+ "name": "wake",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "manifest": {+ "name": "manifest",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "execution_config": {+ "name": "execution_config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "device_id": {+ "name": "device_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false+ },+ "working_directory": {+ "name": "working_directory",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "accepted_at": {+ "name": "accepted_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "lease_owner": {+ "name": "lease_owner",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "lease_expires_at": {+ "name": "lease_expires_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "writer_held": {+ "name": "writer_held",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "isolated_at": {+ "name": "isolated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "draft": {+ "name": "draft",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "publication_revoked": {+ "name": "publication_revoked",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "published_message_id": {+ "name": "published_message_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "channel_jobs_delivery_unique": {+ "name": "channel_jobs_delivery_unique",+ "columns": [+ {+ "expression": "message_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "member_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_channel_status_idx": {+ "name": "channel_jobs_channel_status_idx",+ "columns": [+ {+ "expression": "channel_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_continuation_idx": {+ "name": "channel_jobs_continuation_idx",+ "columns": [+ {+ "expression": "member_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "requester_member_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "thread_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "claimed_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_topic_idx": {+ "name": "channel_jobs_topic_idx",+ "columns": [+ {+ "expression": "topic_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "published_message_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_member_queue_idx": {+ "name": "channel_jobs_member_queue_idx",+ "columns": [+ {+ "expression": "member_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "created_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_lease_expires_idx": {+ "name": "channel_jobs_lease_expires_idx",+ "columns": [+ {+ "expression": "lease_expires_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"channel_jobs\".\"writer_held\" AND \"channel_jobs\".\"isolated_at\" IS NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_jobs_active_directory_idx": {+ "name": "channel_jobs_active_directory_idx",+ "columns": [+ {+ "expression": "device_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "working_directory",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"channel_jobs\".\"writer_held\"",+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "channel_jobs_channel_id_channels_id_fk": {+ "name": "channel_jobs_channel_id_channels_id_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "channels",+ "columnsFrom": [+ "channel_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "channel_jobs_topic_id_topics_id_fk": {+ "name": "channel_jobs_topic_id_topics_id_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "topics",+ "columnsFrom": [+ "topic_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "channel_jobs_operation_id_agent_operations_id_fk": {+ "name": "channel_jobs_operation_id_agent_operations_id_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "agent_operations",+ "columnsFrom": [+ "operation_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "channel_jobs_member_fk": {+ "name": "channel_jobs_member_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "channel_members",+ "columnsFrom": [+ "channel_id",+ "member_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "channel_jobs_requester_fk": {+ "name": "channel_jobs_requester_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "channel_members",+ "columnsFrom": [+ "channel_id",+ "requester_member_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "channel_jobs_message_fk": {+ "name": "channel_jobs_message_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "channel_messages",+ "columnsFrom": [+ "channel_id",+ "message_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "channel_jobs_thread_fk": {+ "name": "channel_jobs_thread_fk",+ "tableFrom": "channel_jobs",+ "tableTo": "channel_threads",+ "columnsFrom": [+ "channel_id",+ "thread_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {+ "channel_jobs_operation_id_unique": {+ "name": "channel_jobs_operation_id_unique",+ "nullsNotDistinct": false,+ "columns": [+ "operation_id"+ ]+ },+ "channel_jobs_scope_unique": {+ "name": "channel_jobs_scope_unique",+ "nullsNotDistinct": false,+ "columns": [+ "channel_id",+ "id"+ ]+ }+ },+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_member_grants": {+ "name": "channel_member_grants",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "channel_id": {+ "name": "channel_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "member_id": {+ "name": "member_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "device_owner_id": {+ "name": "device_owner_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "device_id": {+ "name": "device_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true+ },+ "working_directory": {+ "name": "working_directory",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "requested_by_member_id": {+ "name": "requested_by_member_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'pending'"+ },+ "decided_at": {+ "name": "decided_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "revoked_at": {+ "name": "revoked_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "revoke_reason": {+ "name": "revoke_reason",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false,+ "default": "'{}'::jsonb"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "channel_member_grants_member_unique": {+ "name": "channel_member_grants_member_unique",+ "columns": [+ {+ "expression": "member_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_member_grants_owner_status_idx": {+ "name": "channel_member_grants_owner_status_idx",+ "columns": [+ {+ "expression": "device_owner_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "channel_member_grants_channel_id_channels_id_fk": {+ "name": "channel_member_grants_channel_id_channels_id_fk",+ "tableFrom": "channel_member_grants",+ "tableTo": "channels",+ "columnsFrom": [+ "channel_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "channel_member_grants_device_owner_id_users_id_fk": {+ "name": "channel_member_grants_device_owner_id_users_id_fk",+ "tableFrom": "channel_member_grants",+ "tableTo": "users",+ "columnsFrom": [+ "device_owner_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"},- "isolated_at": {- "name": "isolated_at",- "type": "timestamp with time zone",+ "channel_member_grants_member_fk": {+ "name": "channel_member_grants_member_fk",+ "tableFrom": "channel_member_grants",+ "tableTo": "channel_members",+ "columnsFrom": [+ "channel_id",+ "member_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ },+ "channel_member_grants_requester_fk": {+ "name": "channel_member_grants_requester_fk",+ "tableFrom": "channel_member_grants",+ "tableTo": "channel_members",+ "columnsFrom": [+ "channel_id",+ "requested_by_member_id"+ ],+ "columnsTo": [+ "channel_id",+ "id"+ ],+ "onDelete": "no action",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_members": {+ "name": "channel_members",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "channel_id": {+ "name": "channel_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "actor_type": {+ "name": "actor_type",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text","primaryKey": false,"notNull": false},- "draft": {- "name": "draft",+ "role": {+ "name": "role","type": "text","primaryKey": false,"notNull": false},- "publication_revoked": {- "name": "publication_revoked",+ "last_read_sequence": {+ "name": "last_read_sequence",+ "type": "integer",+ "primaryKey": false,+ "notNull": false+ },+ "section_id": {+ "name": "section_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "pinned": {+ "name": "pinned","type": "boolean","primaryKey": false,"notNull": true,"default": false},- "published_message_id": {- "name": "published_message_id",+ "hidden": {+ "name": "hidden",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "default": false+ },+ "pinned_at": {+ "name": "pinned_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "''"+ },+ "config": {+ "name": "config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false,+ "default": "'{}'::jsonb"+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'active'"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "channel_members_channel_user_unique": {+ "name": "channel_members_channel_user_unique",+ "columns": [+ {+ "expression": "channel_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"channel_members\".\"user_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_members_user_id_idx": {+ "name": "channel_members_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_members_section_id_idx": {+ "name": "channel_members_section_id_idx",+ "columns": [+ {+ "expression": "section_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"channel_members\".\"section_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channel_members_agent_id_idx": {+ "name": "channel_members_agent_id_idx",+ "columns": [+ {+ "expression": "agent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "channel_members_channel_id_channels_id_fk": {+ "name": "channel_members_channel_id_channels_id_fk",+ "tableFrom": "channel_members",+ "tableTo": "channels",+ "columnsFrom": [+ "channel_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "channel_members_user_id_users_id_fk": {+ "name": "channel_members_user_id_users_id_fk",+ "tableFrom": "channel_members",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "channel_members_section_id_channel_sections_id_fk": {+ "name": "channel_members_section_id_channel_sections_id_fk",+ "tableFrom": "channel_members",+ "tableTo": "channel_sections",+ "columnsFrom": [+ "section_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "channel_members_agent_id_agents_id_fk": {+ "name": "channel_members_agent_id_agents_id_fk",+ "tableFrom": "channel_members",+ "tableTo": "agents",+ "columnsFrom": [+ "agent_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {+ "channel_members_scope_unique": {+ "name": "channel_members_scope_unique",+ "nullsNotDistinct": false,+ "columns": [+ "channel_id",+ "id"+ ]+ }+ },+ "policies": {},+ "checkConstraints": {+ "channel_members_actor_type_check": {+ "name": "channel_members_actor_type_check",+ "value": "\"channel_members\".\"actor_type\" IN ('user', 'agent')"+ },+ "channel_members_user_shape_check": {+ "name": "channel_members_user_shape_check",+ "value": "\"channel_members\".\"actor_type\" <> 'user' OR \"channel_members\".\"role\" IS NOT NULL"+ },+ "channel_members_agent_shape_check": {+ "name": "channel_members_agent_shape_check",+ "value": "\"channel_members\".\"actor_type\" <> 'agent' OR (\"channel_members\".\"name\" IS NOT NULL AND \"channel_members\".\"config\" IS NOT NULL)"+ },+ "channel_members_user_id_owner_check": {+ "name": "channel_members_user_id_owner_check",+ "value": "\"channel_members\".\"user_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"+ },+ "channel_members_role_owner_check": {+ "name": "channel_members_role_owner_check",+ "value": "\"channel_members\".\"role\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"+ },+ "channel_members_agent_id_owner_check": {+ "name": "channel_members_agent_id_owner_check",+ "value": "\"channel_members\".\"agent_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'agent'"+ },+ "channel_members_section_id_owner_check": {+ "name": "channel_members_section_id_owner_check",+ "value": "\"channel_members\".\"section_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"+ },+ "channel_members_config_owner_check": {+ "name": "channel_members_config_owner_check",+ "value": "\"channel_members\".\"config\" IS NULL OR \"channel_members\".\"actor_type\" <> 'user'"+ }+ },+ "isRLSEnabled": false+ },+ "public.channel_message_files": {+ "name": "channel_message_files",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "message_id": {+ "name": "message_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "file_id": {+ "name": "file_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "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"+ },+ "channel_message_files_file_id_files_id_fk": {+ "name": "channel_message_files_file_id_files_id_fk",+ "tableFrom": "channel_message_files",+ "tableTo": "files",+ "columnsFrom": [+ "file_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {+ "channel_message_files_message_file_unique": {+ "name": "channel_message_files_message_file_unique",+ "nullsNotDistinct": false,+ "columns": [+ "message_id",+ "file_id"+ ]+ }+ },+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_messages": {+ "name": "channel_messages",+ "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+ },+ "thread_id": {+ "name": "thread_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "sequence": {+ "name": "sequence",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "content": {+ "name": "content",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "mentions": {+ "name": "mentions",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "request_key": {+ "name": "request_key",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "reply_to_id": {+ "name": "reply_to_id","type": "uuid","primaryKey": false,"notNull": false},+ "routing_status": {+ "name": "routing_status",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "routing_source": {+ "name": "routing_source",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "routing_reason": {+ "name": "routing_reason",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "routing_attempt": {+ "name": "routing_attempt",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "recipient_member_ids": {+ "name": "recipient_member_ids",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false,+ "default": "'{}'::jsonb"+ },"created_at": {"name": "created_at","type": "timestamp with time zone","primaryKey": false,"notNull": true,"default": "now()"- },- "updated_at": {- "name": "updated_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": true,- "default": "now()"}},"indexes": {- "channel_jobs_delivery_unique": {- "name": "channel_jobs_delivery_unique",+ "channel_messages_sequence_unique": {+ "name": "channel_messages_sequence_unique","columns": [{- "expression": "message_id",+ "expression": "channel_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "member_id",+ "expression": "sequence","isExpression": false,"asc": true,"nulls": "last"@@ -12113,8 +15687,8 @@"method": "btree","with": {}},- "channel_jobs_channel_status_idx": {- "name": "channel_jobs_channel_status_idx",+ "channel_messages_request_key_unique": {+ "name": "channel_messages_request_key_unique","columns": [{"expression": "channel_id",@@ -12123,28 +15697,22 @@"nulls": "last"},{- "expression": "status",+ "expression": "request_key","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,+ "isUnique": true,"concurrently": false,"method": "btree","with": {}},- "channel_jobs_continuation_idx": {- "name": "channel_jobs_continuation_idx",+ "channel_messages_thread_sequence_idx": {+ "name": "channel_messages_thread_sequence_idx","columns": [{- "expression": "member_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "requester_member_id",+ "expression": "channel_id","isExpression": false,"asc": true,"nulls": "last"@@ -12156,28 +15724,7 @@"nulls": "last"},{- "expression": "claimed_at",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "channel_jobs_topic_idx": {- "name": "channel_jobs_topic_idx",- "columns": [- {- "expression": "topic_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "published_message_id",+ "expression": "sequence","isExpression": false,"asc": true,"nulls": "last"@@ -12188,92 +15735,61 @@"method": "btree","with": {}},- "channel_jobs_member_queue_idx": {- "name": "channel_jobs_member_queue_idx",+ "channel_messages_request_sequence_idx": {+ "name": "channel_messages_request_sequence_idx","columns": [{- "expression": "member_id",+ "expression": "channel_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "status",+ "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": {}- },- "channel_jobs_lease_expires_idx": {- "name": "channel_jobs_lease_expires_idx",- "columns": [- {- "expression": "lease_expires_at",+ "expression": "sequence","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",- "columns": [- {- "expression": "member_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": true,- "where": "\"channel_jobs\".\"writer_held\" AND \"channel_jobs\".\"isolated_at\" IS NULL",+ "where": "\"channel_messages\".\"routing_status\" <> 'reply'","concurrently": false,"method": "btree","with": {}},- "channel_jobs_active_directory_unique": {- "name": "channel_jobs_active_directory_unique",+ "channel_messages_routing_pending_idx": {+ "name": "channel_messages_routing_pending_idx","columns": [{- "expression": "device_id",+ "expression": "channel_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "working_directory",+ "expression": "id","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,+ "where": "\"channel_messages\".\"routing_status\" = 'pending'","concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "channel_jobs_channel_id_channels_id_fk": {- "name": "channel_jobs_channel_id_channels_id_fk",- "tableFrom": "channel_jobs",+ "channel_messages_channel_id_channels_id_fk": {+ "name": "channel_messages_channel_id_channels_id_fk",+ "tableFrom": "channel_messages","tableTo": "channels","columnsFrom": ["channel_id"@@ -12284,12 +15800,12 @@"onDelete": "cascade","onUpdate": "no action"},- "channel_jobs_topic_id_topics_id_fk": {- "name": "channel_jobs_topic_id_topics_id_fk",- "tableFrom": "channel_jobs",- "tableTo": "topics",+ "channel_messages_user_id_users_id_fk": {+ "name": "channel_messages_user_id_users_id_fk",+ "tableFrom": "channel_messages",+ "tableTo": "users","columnsFrom": [- "topic_id"+ "user_id"],"columnsTo": ["id"@@ -12297,12 +15813,12 @@"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",+ "channel_messages_agent_id_agents_id_fk": {+ "name": "channel_messages_agent_id_agents_id_fk",+ "tableFrom": "channel_messages",+ "tableTo": "agents","columnsFrom": [- "operation_id"+ "agent_id"],"columnsTo": ["id"@@ -12310,54 +15826,9 @@"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",- "onUpdate": "no action"- },- "channel_jobs_thread_fk": {- "name": "channel_jobs_thread_fk",- "tableFrom": "channel_jobs",+ "channel_messages_thread_fk": {+ "name": "channel_messages_thread_fk",+ "tableFrom": "channel_messages","tableTo": "channel_threads","columnsFrom": ["channel_id",@@ -12373,15 +15844,8 @@},"compositePrimaryKeys": {},"uniqueConstraints": {- "channel_jobs_operation_id_unique": {- "name": "channel_jobs_operation_id_unique",- "nullsNotDistinct": false,- "columns": [- "operation_id"- ]- },- "channel_jobs_scope_unique": {- "name": "channel_jobs_scope_unique",+ "channel_messages_scope_unique": {+ "name": "channel_messages_scope_unique","nullsNotDistinct": false,"columns": ["channel_id",@@ -12390,11 +15854,20 @@}},"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.channel_member_grants": {- "name": "channel_member_grants",+ "public.channel_sections": {+ "name": "channel_sections","schema": "","columns": {"id": {@@ -12404,73 +15877,36 @@"notNull": true,"default": "gen_random_uuid()"},- "channel_id": {- "name": "channel_id",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "member_id": {- "name": "member_id",- "type": "uuid",- "primaryKey": false,- "notNull": true- },- "device_owner_id": {- "name": "device_owner_id",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,- "notNull": true- },- "device_id": {- "name": "device_id",- "type": "varchar(64)",- "primaryKey": false,- "notNull": true+ "notNull": false},- "working_directory": {- "name": "working_directory",+ "name": {+ "name": "name","type": "text","primaryKey": false,"notNull": true},- "requested_by_member_id": {- "name": "requested_by_member_id",- "type": "uuid",- "primaryKey": false,- "notNull": true- },- "status": {- "name": "status",- "type": "text",- "primaryKey": false,- "notNull": true,- "default": "'pending'"- },- "decided_at": {- "name": "decided_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false- },- "revoked_at": {- "name": "revoked_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false- },- "revoke_reason": {- "name": "revoke_reason",- "type": "text",+ "sort": {+ "name": "sort",+ "type": "integer","primaryKey": false,"notNull": false},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "collapsed": {+ "name": "collapsed",+ "type": "boolean","primaryKey": false,- "notNull": false,- "default": "'{}'::jsonb"+ "notNull": true,+ "default": false},"created_at": {"name": "created_at",@@ -12488,32 +15924,17 @@}},"indexes": {- "channel_member_grants_member_unique": {- "name": "channel_member_grants_member_unique",- "columns": [- {- "expression": "member_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": true,- "concurrently": false,- "method": "btree",- "with": {}- },- "channel_member_grants_owner_status_idx": {- "name": "channel_member_grants_owner_status_idx",+ "channel_sections_user_id_workspace_id_idx": {+ "name": "channel_sections_user_id_workspace_id_idx","columns": [{- "expression": "device_owner_id",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "status",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"@@ -12526,12 +15947,12 @@}},"foreignKeys": {- "channel_member_grants_channel_id_channels_id_fk": {- "name": "channel_member_grants_channel_id_channels_id_fk",- "tableFrom": "channel_member_grants",- "tableTo": "channels",+ "channel_sections_user_id_users_id_fk": {+ "name": "channel_sections_user_id_users_id_fk",+ "tableFrom": "channel_sections",+ "tableTo": "users","columnsFrom": [- "channel_id"+ "user_id"],"columnsTo": ["id"@@ -12539,41 +15960,140 @@"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",+ "channel_sections_workspace_id_workspaces_id_fk": {+ "name": "channel_sections_workspace_id_workspaces_id_fk",+ "tableFrom": "channel_sections",+ "tableTo": "workspaces","columnsFrom": [- "device_owner_id"+ "workspace_id"],"columnsTo": ["id"],"onDelete": "cascade","onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.channel_threads": {+ "name": "channel_threads",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true},- "channel_member_grants_member_fk": {- "name": "channel_member_grants_member_fk",- "tableFrom": "channel_member_grants",- "tableTo": "channel_members",+ "channel_id": {+ "name": "channel_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "root_message_id": {+ "name": "root_message_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": true+ },+ "root_sequence": {+ "name": "root_sequence",+ "type": "integer",+ "primaryKey": false,+ "notNull": true+ },+ "follower_member_ids": {+ "name": "follower_member_ids",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'[]'::jsonb"+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'active'"+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false,+ "default": "'{}'::jsonb"+ },+ "deleted_at": {+ "name": "deleted_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "is_deleted": {+ "name": "is_deleted",+ "type": "boolean",+ "primaryKey": false,+ "notNull": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "channel_threads_root_unique": {+ "name": "channel_threads_root_unique",+ "columns": [+ {+ "expression": "channel_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "root_message_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"channel_threads\".\"is_deleted\" IS NOT TRUE",+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "channel_threads_channel_id_channels_id_fk": {+ "name": "channel_threads_channel_id_channels_id_fk",+ "tableFrom": "channel_threads",+ "tableTo": "channels","columnsFrom": [- "channel_id",- "member_id"+ "channel_id"],"columnsTo": [- "channel_id","id"],- "onDelete": "no action",+ "onDelete": "cascade","onUpdate": "no action"},- "channel_member_grants_requester_fk": {- "name": "channel_member_grants_requester_fk",- "tableFrom": "channel_member_grants",- "tableTo": "channel_members",+ "channel_threads_root_fk": {+ "name": "channel_threads_root_fk",+ "tableFrom": "channel_threads",+ "tableTo": "channel_messages","columnsFrom": ["channel_id",- "requested_by_member_id"+ "root_message_id"],"columnsTo": ["channel_id",@@ -12584,32 +16104,28 @@}},"compositePrimaryKeys": {},- "uniqueConstraints": {},+ "uniqueConstraints": {+ "channel_threads_scope_unique": {+ "name": "channel_threads_scope_unique",+ "nullsNotDistinct": false,+ "columns": [+ "channel_id",+ "id"+ ]+ }+ },"policies": {},"checkConstraints": {},"isRLSEnabled": false},- "public.channel_members": {- "name": "channel_members",+ "public.channels": {+ "name": "channels","schema": "","columns": {"id": {"name": "id",- "type": "uuid",- "primaryKey": true,- "notNull": true,- "default": "gen_random_uuid()"- },- "channel_id": {- "name": "channel_id",- "type": "text",- "primaryKey": false,- "notNull": true- },- "actor_type": {- "name": "actor_type","type": "text",- "primaryKey": false,+ "primaryKey": true,"notNull": true},"user_id": {@@ -12618,15 +16134,15 @@"primaryKey": false,"notNull": false},- "role": {- "name": "role",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "last_read_sequence": {- "name": "last_read_sequence",- "type": "integer",+ "project_id": {+ "name": "project_id",+ "type": "text","primaryKey": false,"notNull": false},@@ -12636,18 +16152,44 @@"primaryKey": false,"notNull": false},- "name": {- "name": "name",+ "peer_user_id": {+ "name": "peer_user_id","type": "text","primaryKey": false,"notNull": false},- "description": {- "name": "description",+ "agent_pair_key": {+ "name": "agent_pair_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "title": {+ "name": "title","type": "text","primaryKey": false,+ "notNull": true+ },+ "sequence": {+ "name": "sequence",+ "type": "integer",+ "primaryKey": false,"notNull": true,- "default": "''"+ "default": 0+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'active'"+ },+ "visibility": {+ "name": "visibility",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'private'"},"config": {"name": "config",@@ -12659,15 +16201,20 @@"name": "metadata","type": "jsonb","primaryKey": false,- "notNull": false,- "default": "'{}'::jsonb"+ "notNull": false,+ "default": "'{}'::jsonb"+ },+ "deleted_at": {+ "name": "deleted_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false},- "status": {- "name": "status",- "type": "text",+ "is_deleted": {+ "name": "is_deleted",+ "type": "boolean","primaryKey": false,- "notNull": true,- "default": "'active'"+ "notNull": false},"created_at": {"name": "created_at",@@ -12685,11 +16232,26 @@}},"indexes": {- "channel_members_channel_user_unique": {- "name": "channel_members_channel_user_unique",+ "channels_user_id_idx": {+ "name": "channels_user_id_idx","columns": [{- "expression": "channel_id",+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channels_direct_unique": {+ "name": "channels_direct_unique",+ "columns": [+ {+ "expression": "agent_id","isExpression": false,"asc": true,"nulls": "last"@@ -12699,34 +16261,75 @@"isExpression": false,"asc": true,"nulls": "last"+ },+ {+ "expression": "coalesce(\"workspace_id\", '')",+ "asc": true,+ "isExpression": true,+ "nulls": "last"}],"isUnique": true,- "where": "\"channel_members\".\"user_id\" IS NOT NULL",+ "where": "\"channels\".\"agent_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "channel_members_user_id_idx": {- "name": "channel_members_user_id_idx",+ "channels_agent_pair_unique": {+ "name": "channels_agent_pair_unique","columns": [+ {+ "expression": "agent_pair_key",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },{"expression": "user_id","isExpression": false,"asc": true,"nulls": "last"+ },+ {+ "expression": "coalesce(\"workspace_id\", '')",+ "asc": true,+ "isExpression": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"channels\".\"agent_pair_key\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "channels_project_id_idx": {+ "name": "channels_project_id_idx",+ "columns": [+ {+ "expression": "project_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"}],"isUnique": false,+ "where": "\"channels\".\"project_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "channel_members_agent_id_idx": {- "name": "channel_members_agent_id_idx",+ "channels_workspace_visibility_idx": {+ "name": "channels_workspace_visibility_idx","columns": [{- "expression": "agent_id",+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "visibility","isExpression": false,"asc": true,"nulls": "last"@@ -12739,144 +16342,51 @@}},"foreignKeys": {- "channel_members_channel_id_channels_id_fk": {- "name": "channel_members_channel_id_channels_id_fk",- "tableFrom": "channel_members",- "tableTo": "channels",+ "channels_user_id_users_id_fk": {+ "name": "channels_user_id_users_id_fk",+ "tableFrom": "channels",+ "tableTo": "users","columnsFrom": [- "channel_id"+ "user_id"],"columnsTo": ["id"],- "onDelete": "cascade",+ "onDelete": "set null","onUpdate": "no action"},- "channel_members_user_id_users_id_fk": {- "name": "channel_members_user_id_users_id_fk",- "tableFrom": "channel_members",- "tableTo": "users",+ "channels_workspace_id_workspaces_id_fk": {+ "name": "channels_workspace_id_workspaces_id_fk",+ "tableFrom": "channels",+ "tableTo": "workspaces","columnsFrom": [- "user_id"+ "workspace_id"],"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"},- "channel_members_agent_id_agents_id_fk": {- "name": "channel_members_agent_id_agents_id_fk",- "tableFrom": "channel_members",- "tableTo": "agents",+ "channels_project_id_projects_id_fk": {+ "name": "channels_project_id_projects_id_fk",+ "tableFrom": "channels",+ "tableTo": "projects","columnsFrom": [- "agent_id"+ "project_id"],"columnsTo": ["id"],"onDelete": "set null","onUpdate": "no action"- }- },- "compositePrimaryKeys": {},- "uniqueConstraints": {- "channel_members_scope_unique": {- "name": "channel_members_scope_unique",- "nullsNotDistinct": false,- "columns": [- "channel_id",- "id"- ]- }- },- "policies": {},- "checkConstraints": {- "channel_members_actor_type_check": {- "name": "channel_members_actor_type_check",- "value": "\"channel_members\".\"actor_type\" IN ('user', 'agent')"- },- "channel_members_user_shape_check": {- "name": "channel_members_user_shape_check",- "value": "\"channel_members\".\"actor_type\" <> 'user' OR \"channel_members\".\"role\" IS NOT NULL"- },- "channel_members_agent_shape_check": {- "name": "channel_members_agent_shape_check",- "value": "\"channel_members\".\"actor_type\" <> 'agent' OR (\"channel_members\".\"name\" IS NOT NULL AND \"channel_members\".\"config\" IS NOT NULL)"- },- "channel_members_user_id_owner_check": {- "name": "channel_members_user_id_owner_check",- "value": "\"channel_members\".\"user_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"- },- "channel_members_role_owner_check": {- "name": "channel_members_role_owner_check",- "value": "\"channel_members\".\"role\" IS NULL OR \"channel_members\".\"actor_type\" = 'user'"- },- "channel_members_agent_id_owner_check": {- "name": "channel_members_agent_id_owner_check",- "value": "\"channel_members\".\"agent_id\" IS NULL OR \"channel_members\".\"actor_type\" = 'agent'"- },- "channel_members_config_owner_check": {- "name": "channel_members_config_owner_check",- "value": "\"channel_members\".\"config\" IS NULL OR \"channel_members\".\"actor_type\" <> 'user'"- }- },- "isRLSEnabled": false- },- "public.channel_message_files": {- "name": "channel_message_files",- "schema": "",- "columns": {- "id": {- "name": "id",- "type": "uuid",- "primaryKey": true,- "notNull": true,- "default": "gen_random_uuid()"- },- "message_id": {- "name": "message_id",- "type": "uuid",- "primaryKey": false,- "notNull": true- },- "file_id": {- "name": "file_id",- "type": "text",- "primaryKey": false,- "notNull": true},- "sort_order": {- "name": "sort_order",- "type": "integer",- "primaryKey": false,- "notNull": true- }- },- "indexes": {- "channel_message_files_file_idx": {- "name": "channel_message_files_file_idx",- "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",+ "channels_agent_id_agents_id_fk": {+ "name": "channels_agent_id_agents_id_fk",+ "tableFrom": "channels",+ "tableTo": "agents","columnsFrom": [- "message_id"+ "agent_id"],"columnsTo": ["id"@@ -12884,12 +16394,12 @@"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",+ "channels_peer_user_id_users_id_fk": {+ "name": "channels_peer_user_id_users_id_fk",+ "tableFrom": "channels",+ "tableTo": "users","columnsFrom": [- "file_id"+ "peer_user_id"],"columnsTo": ["id"@@ -12899,124 +16409,130 @@}},"compositePrimaryKeys": {},- "uniqueConstraints": {- "channel_message_files_message_file_unique": {- "name": "channel_message_files_message_file_unique",- "nullsNotDistinct": false,- "columns": [- "message_id",- "file_id"- ]+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {+ "channels_direct_visibility_check": {+ "name": "channels_direct_visibility_check",+ "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"}},- "policies": {},- "checkConstraints": {},"isRLSEnabled": false},- "public.channel_messages": {- "name": "channel_messages",+ "public.chat_groups": {+ "name": "chat_groups","schema": "","columns": {"id": {"name": "id",- "type": "uuid",+ "type": "text","primaryKey": true,- "notNull": true,- "default": "gen_random_uuid()"+ "notNull": true},- "channel_id": {- "name": "channel_id",+ "title": {+ "name": "title","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "thread_id": {- "name": "thread_id",+ "description": {+ "name": "description","type": "text","primaryKey": false,"notNull": false},- "sequence": {- "name": "sequence",- "type": "integer",+ "avatar": {+ "name": "avatar",+ "type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "content": {- "name": "content",+ "background_color": {+ "name": "background_color","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "user_id": {- "name": "user_id",+ "market_identifier": {+ "name": "market_identifier","type": "text","primaryKey": false,"notNull": false},- "agent_id": {- "name": "agent_id",+ "content": {+ "name": "content","type": "text","primaryKey": false,"notNull": false},- "mentions": {- "name": "mentions",+ "editor_data": {+ "name": "editor_data","type": "jsonb","primaryKey": false,- "notNull": true,- "default": "'[]'::jsonb"+ "notNull": false},- "request_key": {- "name": "request_key",- "type": "text",+ "config": {+ "name": "config",+ "type": "jsonb","primaryKey": false,- "notNull": true+ "notNull": false},- "reply_to_id": {- "name": "reply_to_id",- "type": "uuid",+ "client_id": {+ "name": "client_id",+ "type": "text","primaryKey": false,"notNull": false},- "routing_status": {- "name": "routing_status",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "routing_source": {- "name": "routing_source",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "routing_reason": {- "name": "routing_reason",+ "group_id": {+ "name": "group_id","type": "text","primaryKey": false,"notNull": false},- "routing_attempt": {- "name": "routing_attempt",- "type": "integer",+ "pinned": {+ "name": "pinned",+ "type": "boolean","primaryKey": false,- "notNull": true,- "default": 0+ "notNull": false,+ "default": false},- "recipient_member_ids": {- "name": "recipient_member_ids",- "type": "jsonb",+ "visibility": {+ "name": "visibility",+ "type": "text","primaryKey": false,"notNull": true,- "default": "'[]'::jsonb"+ "default": "'public'"},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "deleted_at": {+ "name": "deleted_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false,- "default": "'{}'::jsonb"+ "notNull": false+ },+ "is_deleted": {+ "name": "is_deleted",+ "type": "boolean",+ "primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"},"created_at": {"name": "created_at",@@ -13024,20 +16540,27 @@"primaryKey": false,"notNull": true,"default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"}},"indexes": {- "channel_messages_sequence_unique": {- "name": "channel_messages_sequence_unique",+ "chat_groups_client_id_user_id_unique": {+ "name": "chat_groups_client_id_user_id_unique","columns": [{- "expression": "channel_id",+ "expression": "client_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "sequence",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"@@ -13048,44 +16571,26 @@"method": "btree","with": {}},- "channel_messages_request_key_unique": {- "name": "channel_messages_request_key_unique",+ "chat_groups_user_id_idx": {+ "name": "chat_groups_user_id_idx","columns": [{- "expression": "channel_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "request_key",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": true,+ "isUnique": false,"concurrently": false,"method": "btree","with": {}},- "channel_messages_thread_sequence_idx": {- "name": "channel_messages_thread_sequence_idx",+ "chat_groups_group_id_idx": {+ "name": "chat_groups_group_id_idx","columns": [{- "expression": "channel_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "thread_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "sequence",+ "expression": "group_id","isExpression": false,"asc": true,"nulls": "last"@@ -13096,74 +16601,53 @@"method": "btree","with": {}},- "channel_messages_request_sequence_idx": {- "name": "channel_messages_request_sequence_idx",+ "chat_groups_workspace_id_idx": {+ "name": "chat_groups_workspace_id_idx","columns": [{- "expression": "channel_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "thread_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },- {- "expression": "sequence",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": false,- "where": "\"channel_messages\".\"routing_status\" <> 'reply'","concurrently": false,"method": "btree","with": {}},- "channel_messages_routing_pending_idx": {- "name": "channel_messages_routing_pending_idx",+ "chat_groups_workspace_visibility_idx": {+ "name": "chat_groups_workspace_visibility_idx","columns": [{- "expression": "channel_id",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "id",+ "expression": "visibility",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": false,- "where": "\"channel_messages\".\"routing_status\" = 'pending'","concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "channel_messages_channel_id_channels_id_fk": {- "name": "channel_messages_channel_id_channels_id_fk",- "tableFrom": "channel_messages",- "tableTo": "channels",- "columnsFrom": [- "channel_id"- ],- "columnsTo": [- "id"- ],- "onDelete": "cascade",- "onUpdate": "no action"- },- "channel_messages_user_id_users_id_fk": {- "name": "channel_messages_user_id_users_id_fk",- "tableFrom": "channel_messages",+ "chat_groups_user_id_users_id_fk": {+ "name": "chat_groups_user_id_users_id_fk",+ "tableFrom": "chat_groups","tableTo": "users","columnsFrom": ["user_id"@@ -13171,126 +16655,97 @@"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"},- "channel_messages_agent_id_agents_id_fk": {- "name": "channel_messages_agent_id_agents_id_fk",- "tableFrom": "channel_messages",- "tableTo": "agents",+ "chat_groups_workspace_id_workspaces_id_fk": {+ "name": "chat_groups_workspace_id_workspaces_id_fk",+ "tableFrom": "chat_groups",+ "tableTo": "workspaces","columnsFrom": [- "agent_id"+ "workspace_id"],"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"},- "channel_messages_thread_fk": {- "name": "channel_messages_thread_fk",- "tableFrom": "channel_messages",- "tableTo": "channel_threads",+ "chat_groups_group_id_session_groups_id_fk": {+ "name": "chat_groups_group_id_session_groups_id_fk",+ "tableFrom": "chat_groups",+ "tableTo": "session_groups","columnsFrom": [- "channel_id",- "thread_id"+ "group_id"],"columnsTo": [- "channel_id","id"],- "onDelete": "no action",+ "onDelete": "set null","onUpdate": "no action"}},"compositePrimaryKeys": {},- "uniqueConstraints": {- "channel_messages_scope_unique": {- "name": "channel_messages_scope_unique",- "nullsNotDistinct": false,- "columns": [- "channel_id",- "id"- ]- }- },+ "uniqueConstraints": {},"policies": {},- "checkConstraints": {- "channel_messages_sender_check": {- "name": "channel_messages_sender_check",- "value": "\"channel_messages\".\"user_id\" IS NULL OR \"channel_messages\".\"agent_id\" IS NULL"- },- "channel_messages_user_sender_check": {- "name": "channel_messages_user_sender_check",- "value": "\"channel_messages\".\"routing_status\" <> 'reply' OR \"channel_messages\".\"user_id\" IS NULL"- },- "channel_messages_agent_sender_check": {- "name": "channel_messages_agent_sender_check",- "value": "\"channel_messages\".\"routing_status\" = 'reply' OR \"channel_messages\".\"agent_id\" IS NULL"- }- },+ "checkConstraints": {},"isRLSEnabled": false- },- "public.channel_threads": {- "name": "channel_threads",+ },+ "public.chat_groups_agents": {+ "name": "chat_groups_agents","schema": "","columns": {- "id": {- "name": "id",+ "chat_group_id": {+ "name": "chat_group_id","type": "text",- "primaryKey": true,+ "primaryKey": false,"notNull": true},- "channel_id": {- "name": "channel_id",+ "agent_id": {+ "name": "agent_id","type": "text","primaryKey": false,"notNull": true},- "root_message_id": {- "name": "root_message_id",- "type": "uuid",+ "user_id": {+ "name": "user_id",+ "type": "text","primaryKey": false,"notNull": true},- "root_sequence": {- "name": "root_sequence",- "type": "integer",+ "workspace_id": {+ "name": "workspace_id",+ "type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "follower_member_ids": {- "name": "follower_member_ids",- "type": "jsonb",+ "enabled": {+ "name": "enabled",+ "type": "boolean","primaryKey": false,- "notNull": true,- "default": "'[]'::jsonb"+ "notNull": false,+ "default": true},- "status": {- "name": "status",- "type": "text",+ "order": {+ "name": "order",+ "type": "integer","primaryKey": false,- "notNull": true,- "default": "'active'"+ "notNull": false,+ "default": 0},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "role": {+ "name": "role",+ "type": "text","primaryKey": false,"notNull": false,- "default": "'{}'::jsonb"+ "default": "'participant'"},- "deleted_at": {- "name": "deleted_at",+ "accessed_at": {+ "name": "accessed_at","type": "timestamp with time zone","primaryKey": false,- "notNull": false- },- "is_deleted": {- "name": "is_deleted",- "type": "boolean",- "primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},"created_at": {"name": "created_at",@@ -13298,39 +16753,54 @@"primaryKey": false,"notNull": true,"default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"}},"indexes": {- "channel_threads_root_unique": {- "name": "channel_threads_root_unique",+ "chat_groups_agents_user_id_idx": {+ "name": "chat_groups_agents_user_id_idx","columns": [{- "expression": "channel_id",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"- },+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "chat_groups_agents_workspace_id_idx": {+ "name": "chat_groups_agents_workspace_id_idx",+ "columns": [{- "expression": "root_message_id",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": true,- "where": "\"channel_threads\".\"is_deleted\" IS NOT TRUE",+ "isUnique": false,"concurrently": false,"method": "btree","with": {}}},"foreignKeys": {- "channel_threads_channel_id_channels_id_fk": {- "name": "channel_threads_channel_id_channels_id_fk",- "tableFrom": "channel_threads",- "tableTo": "channels",+ "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": [- "channel_id"+ "chat_group_id"],"columnsTo": ["id"@@ -13338,52 +16808,82 @@"onDelete": "cascade","onUpdate": "no action"},- "channel_threads_root_fk": {- "name": "channel_threads_root_fk",- "tableFrom": "channel_threads",- "tableTo": "channel_messages",+ "chat_groups_agents_agent_id_agents_id_fk": {+ "name": "chat_groups_agents_agent_id_agents_id_fk",+ "tableFrom": "chat_groups_agents",+ "tableTo": "agents","columnsFrom": [- "channel_id",- "root_message_id"+ "agent_id"],"columnsTo": [- "channel_id","id"],- "onDelete": "no action",+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "chat_groups_agents_user_id_users_id_fk": {+ "name": "chat_groups_agents_user_id_users_id_fk",+ "tableFrom": "chat_groups_agents",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "chat_groups_agents_workspace_id_workspaces_id_fk": {+ "name": "chat_groups_agents_workspace_id_workspaces_id_fk",+ "tableFrom": "chat_groups_agents",+ "tableTo": "workspaces",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade","onUpdate": "no action"}},- "compositePrimaryKeys": {},- "uniqueConstraints": {- "channel_threads_scope_unique": {- "name": "channel_threads_scope_unique",- "nullsNotDistinct": false,+ "compositePrimaryKeys": {+ "chat_groups_agents_chat_group_id_agent_id_pk": {+ "name": "chat_groups_agents_chat_group_id_agent_id_pk","columns": [- "channel_id",- "id"+ "chat_group_id",+ "agent_id"]}},+ "uniqueConstraints": {},"policies": {},"checkConstraints": {},"isRLSEnabled": false},- "public.channels": {- "name": "channels",+ "public.user_connector_tools": {+ "name": "user_connector_tools","schema": "","columns": {"id": {"name": "id",- "type": "text",+ "type": "uuid","primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "user_connector_id": {+ "name": "user_connector_id",+ "type": "uuid",+ "primaryKey": false,"notNull": true},"user_id": {"name": "user_id","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},"workspace_id": {"name": "workspace_id",@@ -13391,69 +16891,85 @@"primaryKey": false,"notNull": false},- "project_id": {- "name": "project_id",- "type": "text",+ "tool_name": {+ "name": "tool_name",+ "type": "varchar(255)",+ "primaryKey": false,+ "notNull": true+ },+ "display_name": {+ "name": "display_name",+ "type": "varchar(255)","primaryKey": false,"notNull": false},- "agent_id": {- "name": "agent_id",+ "description": {+ "name": "description","type": "text","primaryKey": false,"notNull": false},- "title": {- "name": "title",+ "input_schema": {+ "name": "input_schema",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "output_schema": {+ "name": "output_schema",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "crud_type": {+ "name": "crud_type","type": "text","primaryKey": false,"notNull": true},- "sequence": {- "name": "sequence",- "type": "integer",+ "render_config": {+ "name": "render_config",+ "type": "jsonb","primaryKey": false,- "notNull": true,- "default": 0+ "notNull": false},- "status": {- "name": "status",+ "permission": {+ "name": "permission","type": "text","primaryKey": false,- "notNull": true,- "default": "'active'"+ "notNull": true},- "visibility": {- "name": "visibility",- "type": "text",+ "is_work_artifact": {+ "name": "is_work_artifact",+ "type": "boolean","primaryKey": false,"notNull": true,- "default": "'private'"+ "default": false},- "config": {- "name": "config",+ "work_artifact_config": {+ "name": "work_artifact_config","type": "jsonb","primaryKey": false,"notNull": false},- "metadata": {- "name": "metadata",+ "limit_config": {+ "name": "limit_config","type": "jsonb","primaryKey": false,- "notNull": false,- "default": "'{}'::jsonb"+ "notNull": false},- "deleted_at": {- "name": "deleted_at",- "type": "timestamp with time zone",+ "metadata": {+ "name": "metadata",+ "type": "jsonb","primaryKey": false,"notNull": false},- "is_deleted": {- "name": "is_deleted",- "type": "boolean",+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"},"created_at": {"name": "created_at",@@ -13471,79 +16987,65 @@}},"indexes": {- "channels_user_id_idx": {- "name": "channels_user_id_idx",+ "user_connector_tools_connector_tool_unique": {+ "name": "user_connector_tools_connector_tool_unique","columns": [{- "expression": "user_id",+ "expression": "user_connector_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "tool_name","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,+ "isUnique": true,"concurrently": false,"method": "btree","with": {}},- "channels_direct_unique": {- "name": "channels_direct_unique",+ "user_connector_tools_user_id_idx": {+ "name": "user_connector_tools_user_id_idx","columns": [- {- "expression": "agent_id",- "isExpression": false,- "asc": true,- "nulls": "last"- },{"expression": "user_id","isExpression": false,"asc": true,"nulls": "last"- },- {- "expression": "coalesce(\"workspace_id\", '')",- "asc": true,- "isExpression": true,- "nulls": "last"}],- "isUnique": true,- "where": "\"channels\".\"agent_id\" IS NOT NULL",+ "isUnique": false,"concurrently": false,"method": "btree","with": {}},- "channels_project_id_idx": {- "name": "channels_project_id_idx",+ "user_connector_tools_connector_id_idx": {+ "name": "user_connector_tools_connector_id_idx","columns": [{- "expression": "project_id",+ "expression": "user_connector_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": false,- "where": "\"channels\".\"project_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "channels_workspace_visibility_idx": {- "name": "channels_workspace_visibility_idx",+ "user_connector_tools_workspace_id_idx": {+ "name": "user_connector_tools_workspace_id_idx","columns": [{"expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"- },- {- "expression": "visibility",- "isExpression": false,- "asc": true,- "nulls": "last"}],"isUnique": false,@@ -13553,25 +17055,12 @@}},"foreignKeys": {- "channels_user_id_users_id_fk": {- "name": "channels_user_id_users_id_fk",- "tableFrom": "channels",- "tableTo": "users",- "columnsFrom": [- "user_id"- ],- "columnsTo": [- "id"- ],- "onDelete": "set null",- "onUpdate": "no action"- },- "channels_workspace_id_workspaces_id_fk": {- "name": "channels_workspace_id_workspaces_id_fk",- "tableFrom": "channels",- "tableTo": "workspaces",+ "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": [- "workspace_id"+ "user_connector_id"],"columnsTo": ["id"@@ -13579,25 +17068,25 @@"onDelete": "cascade","onUpdate": "no action"},- "channels_project_id_projects_id_fk": {- "name": "channels_project_id_projects_id_fk",- "tableFrom": "channels",- "tableTo": "projects",+ "user_connector_tools_user_id_users_id_fk": {+ "name": "user_connector_tools_user_id_users_id_fk",+ "tableFrom": "user_connector_tools",+ "tableTo": "users","columnsFrom": [- "project_id"+ "user_id"],"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"},- "channels_agent_id_agents_id_fk": {- "name": "channels_agent_id_agents_id_fk",- "tableFrom": "channels",- "tableTo": "agents",+ "user_connector_tools_workspace_id_workspaces_id_fk": {+ "name": "user_connector_tools_workspace_id_workspaces_id_fk",+ "tableFrom": "user_connector_tools",+ "tableTo": "workspaces","columnsFrom": [- "agent_id"+ "workspace_id"],"columnsTo": ["id"@@ -13609,102 +17098,110 @@"compositePrimaryKeys": {},"uniqueConstraints": {},"policies": {},- "checkConstraints": {- "channels_direct_visibility_check": {- "name": "channels_direct_visibility_check",- "value": "\"channels\".\"agent_id\" IS NULL OR \"channels\".\"visibility\" = 'private'"- }- },+ "checkConstraints": {},"isRLSEnabled": false},- "public.chat_groups": {- "name": "chat_groups",+ "public.user_connectors": {+ "name": "user_connectors","schema": "","columns": {"id": {"name": "id",- "type": "text",+ "type": "uuid","primaryKey": true,- "notNull": true+ "notNull": true,+ "default": "gen_random_uuid()"},- "title": {- "name": "title",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "description": {- "name": "description",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,"notNull": false},- "avatar": {- "name": "avatar",+ "agent_id": {+ "name": "agent_id","type": "text","primaryKey": false,"notNull": false},- "background_color": {- "name": "background_color",- "type": "text",+ "identifier": {+ "name": "identifier",+ "type": "varchar(255)","primaryKey": false,- "notNull": false+ "notNull": true},- "market_identifier": {- "name": "market_identifier",+ "name": {+ "name": "name",+ "type": "varchar(255)",+ "primaryKey": false,+ "notNull": true+ },+ "source_type": {+ "name": "source_type","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "content": {- "name": "content",+ "mcp_server_url": {+ "name": "mcp_server_url","type": "text","primaryKey": false,"notNull": false},- "editor_data": {- "name": "editor_data",- "type": "jsonb",+ "mcp_connection_type": {+ "name": "mcp_connection_type",+ "type": "text","primaryKey": false,"notNull": false},- "config": {- "name": "config",+ "mcp_stdio_config": {+ "name": "mcp_stdio_config","type": "jsonb","primaryKey": false,"notNull": false},- "client_id": {- "name": "client_id",+ "status": {+ "name": "status","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "user_id": {- "name": "user_id",- "type": "text",+ "is_enabled": {+ "name": "is_enabled",+ "type": "boolean","primaryKey": false,- "notNull": true+ "notNull": true,+ "default": true},- "workspace_id": {- "name": "workspace_id",- "type": "text",+ "oidc_config": {+ "name": "oidc_config",+ "type": "jsonb","primaryKey": false,"notNull": false},- "group_id": {- "name": "group_id",+ "credentials": {+ "name": "credentials","type": "text","primaryKey": false,"notNull": false},- "pinned": {- "name": "pinned",- "type": "boolean",+ "token_expires_at": {+ "name": "token_expires_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false,- "default": false+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false},"visibility": {"name": "visibility",@@ -13713,18 +17210,6 @@"notNull": true,"default": "'public'"},- "deleted_at": {- "name": "deleted_at",- "type": "timestamp with time zone",- "primaryKey": false,- "notNull": false- },- "is_deleted": {- "name": "is_deleted",- "type": "boolean",- "primaryKey": false,- "notNull": false- },"accessed_at": {"name": "accessed_at","type": "timestamp with time zone",@@ -13748,29 +17233,80 @@}},"indexes": {- "chat_groups_client_id_user_id_unique": {- "name": "chat_groups_client_id_user_id_unique",+ "user_connectors_personal_identifier_idx": {+ "name": "user_connectors_personal_identifier_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"user_connectors\".\"workspace_id\" IS NULL AND \"user_connectors\".\"agent_id\" IS NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_connectors_workspace_identifier_idx": {+ "name": "user_connectors_workspace_identifier_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "identifier",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_connectors_agent_identifier_idx": {+ "name": "user_connectors_agent_identifier_idx","columns": [{- "expression": "client_id",+ "expression": "agent_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "user_id",+ "expression": "identifier","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": true,+ "isUnique": false,+ "where": "\"user_connectors\".\"agent_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "chat_groups_user_id_idx": {- "name": "chat_groups_user_id_idx",+ "user_connectors_user_id_idx": {+ "name": "user_connectors_user_id_idx","columns": [{"expression": "user_id",@@ -13784,11 +17320,11 @@"method": "btree","with": {}},- "chat_groups_group_id_idx": {- "name": "chat_groups_group_id_idx",+ "user_connectors_token_expires_at_idx": {+ "name": "user_connectors_token_expires_at_idx","columns": [{- "expression": "group_id",+ "expression": "token_expires_at","isExpression": false,"asc": true,"nulls": "last"@@ -13799,8 +17335,8 @@"method": "btree","with": {}},- "chat_groups_workspace_id_idx": {- "name": "chat_groups_workspace_id_idx",+ "user_connectors_workspace_id_idx": {+ "name": "user_connectors_workspace_id_idx","columns": [{"expression": "workspace_id",@@ -13814,23 +17350,11 @@"method": "btree","with": {}},- "chat_groups_workspace_visibility_idx": {- "name": "chat_groups_workspace_visibility_idx",+ "user_connectors_agent_id_idx": {+ "name": "user_connectors_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"@@ -13843,9 +17367,9 @@}},"foreignKeys": {- "chat_groups_user_id_users_id_fk": {- "name": "chat_groups_user_id_users_id_fk",- "tableFrom": "chat_groups",+ "user_connectors_user_id_users_id_fk": {+ "name": "user_connectors_user_id_users_id_fk",+ "tableFrom": "user_connectors","tableTo": "users","columnsFrom": ["user_id"@@ -13856,9 +17380,9 @@"onDelete": "cascade","onUpdate": "no action"},- "chat_groups_workspace_id_workspaces_id_fk": {- "name": "chat_groups_workspace_id_workspaces_id_fk",- "tableFrom": "chat_groups",+ "user_connectors_workspace_id_workspaces_id_fk": {+ "name": "user_connectors_workspace_id_workspaces_id_fk",+ "tableFrom": "user_connectors","tableTo": "workspaces","columnsFrom": ["workspace_id"@@ -13869,17 +17393,17 @@"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",+ "user_connectors_agent_id_agents_id_fk": {+ "name": "user_connectors_agent_id_agents_id_fk",+ "tableFrom": "user_connectors",+ "tableTo": "agents","columnsFrom": [- "group_id"+ "agent_id"],"columnsTo": ["id"],- "onDelete": "set null",+ "onDelete": "cascade","onUpdate": "no action"}},@@ -13889,54 +17413,57 @@"checkConstraints": {},"isRLSEnabled": false},- "public.chat_groups_agents": {- "name": "chat_groups_agents",+ "public.user_installed_plugins": {+ "name": "user_installed_plugins","schema": "","columns": {- "chat_group_id": {- "name": "chat_group_id",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,"notNull": true},- "agent_id": {- "name": "agent_id",+ "workspace_id": {+ "name": "workspace_id","type": "text","primaryKey": false,- "notNull": true+ "notNull": false},- "user_id": {- "name": "user_id",+ "identifier": {+ "name": "identifier","type": "text","primaryKey": false,"notNull": true},- "workspace_id": {- "name": "workspace_id",+ "type": {+ "name": "type","type": "text","primaryKey": false,+ "notNull": true+ },+ "manifest": {+ "name": "manifest",+ "type": "jsonb",+ "primaryKey": false,"notNull": false},- "enabled": {- "name": "enabled",- "type": "boolean",+ "settings": {+ "name": "settings",+ "type": "jsonb","primaryKey": false,- "notNull": false,- "default": true+ "notNull": false},- "order": {- "name": "order",- "type": "integer",+ "custom_params": {+ "name": "custom_params",+ "type": "jsonb","primaryKey": false,- "notNull": false,- "default": 0+ "notNull": false},- "role": {- "name": "role",- "type": "text",+ "source": {+ "name": "source",+ "type": "varchar(255)","primaryKey": false,- "notNull": false,- "default": "'participant'"+ "notNull": false},"accessed_at": {"name": "accessed_at",@@ -13961,23 +17488,8 @@}},"indexes": {- "chat_groups_agents_user_id_idx": {- "name": "chat_groups_agents_user_id_idx",- "columns": [- {- "expression": "user_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- },- "chat_groups_agents_workspace_id_idx": {- "name": "chat_groups_agents_workspace_id_idx",+ "user_installed_plugins_workspace_id_idx": {+ "name": "user_installed_plugins_workspace_id_idx","columns": [{"expression": "workspace_id",@@ -13993,35 +17505,9 @@}},"foreignKeys": {- "chat_groups_agents_chat_group_id_chat_groups_id_fk": {- "name": "chat_groups_agents_chat_group_id_chat_groups_id_fk",- "tableFrom": "chat_groups_agents",- "tableTo": "chat_groups",- "columnsFrom": [- "chat_group_id"- ],- "columnsTo": [- "id"- ],- "onDelete": "cascade",- "onUpdate": "no action"- },- "chat_groups_agents_agent_id_agents_id_fk": {- "name": "chat_groups_agents_agent_id_agents_id_fk",- "tableFrom": "chat_groups_agents",- "tableTo": "agents",- "columnsFrom": [- "agent_id"- ],- "columnsTo": [- "id"- ],- "onDelete": "cascade",- "onUpdate": "no action"- },- "chat_groups_agents_user_id_users_id_fk": {- "name": "chat_groups_agents_user_id_users_id_fk",- "tableFrom": "chat_groups_agents",+ "user_installed_plugins_user_id_users_id_fk": {+ "name": "user_installed_plugins_user_id_users_id_fk",+ "tableFrom": "user_installed_plugins","tableTo": "users","columnsFrom": ["user_id"@@ -14032,9 +17518,9 @@"onDelete": "cascade","onUpdate": "no action"},- "chat_groups_agents_workspace_id_workspaces_id_fk": {- "name": "chat_groups_agents_workspace_id_workspaces_id_fk",- "tableFrom": "chat_groups_agents",+ "user_installed_plugins_workspace_id_workspaces_id_fk": {+ "name": "user_installed_plugins_workspace_id_workspaces_id_fk",+ "tableFrom": "user_installed_plugins","tableTo": "workspaces","columnsFrom": ["workspace_id"@@ -14047,11 +17533,11 @@}},"compositePrimaryKeys": {- "chat_groups_agents_chat_group_id_agent_id_pk": {- "name": "chat_groups_agents_chat_group_id_agent_id_pk",+ "user_installed_plugins_user_id_identifier_pk": {+ "name": "user_installed_plugins_user_id_identifier_pk","columns": [- "chat_group_id",- "agent_id"+ "user_id",+ "identifier"]}},@@ -14060,8 +17546,8 @@"checkConstraints": {},"isRLSEnabled": false},- "public.user_connector_tools": {- "name": "user_connector_tools",+ "public.user_contact_requests": {+ "name": "user_contact_requests","schema": "","columns": {"id": {@@ -14071,14 +17557,14 @@"notNull": true,"default": "gen_random_uuid()"},- "user_connector_id": {- "name": "user_connector_id",- "type": "uuid",+ "requester_id": {+ "name": "requester_id",+ "type": "text","primaryKey": false,"notNull": true},- "user_id": {- "name": "user_id",+ "addressee_id": {+ "name": "addressee_id","type": "text","primaryKey": false,"notNull": true@@ -14089,76 +17575,22 @@"primaryKey": false,"notNull": false},- "tool_name": {- "name": "tool_name",- "type": "varchar(255)",- "primaryKey": false,- "notNull": true- },- "display_name": {- "name": "display_name",- "type": "varchar(255)",- "primaryKey": false,- "notNull": false- },- "description": {- "name": "description",- "type": "text",- "primaryKey": false,- "notNull": false- },- "input_schema": {- "name": "input_schema",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "output_schema": {- "name": "output_schema",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "crud_type": {- "name": "crud_type",+ "message": {+ "name": "message","type": "text","primaryKey": false,- "notNull": true- },- "render_config": {- "name": "render_config",- "type": "jsonb",- "primaryKey": false,"notNull": false},- "permission": {- "name": "permission",+ "status": {+ "name": "status","type": "text","primaryKey": false,- "notNull": true- },- "is_work_artifact": {- "name": "is_work_artifact",- "type": "boolean",- "primaryKey": false,"notNull": true,- "default": false- },- "work_artifact_config": {- "name": "work_artifact_config",- "type": "jsonb",- "primaryKey": false,- "notNull": false- },- "limit_config": {- "name": "limit_config",- "type": "jsonb",- "primaryKey": false,- "notNull": false+ "default": "'pending'"},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "responded_at": {+ "name": "responded_at",+ "type": "timestamp with time zone","primaryKey": false,"notNull": false},@@ -14185,32 +17617,67 @@}},"indexes": {- "user_connector_tools_connector_tool_unique": {- "name": "user_connector_tools_connector_tool_unique",+ "user_contact_requests_pending_unique": {+ "name": "user_contact_requests_pending_unique","columns": [{- "expression": "user_connector_id",+ "expression": "requester_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "tool_name",+ "expression": "addressee_id","isExpression": false,"asc": true,"nulls": "last"}],"isUnique": true,+ "where": "\"user_contact_requests\".\"status\" = 'pending' AND \"user_contact_requests\".\"workspace_id\" IS NULL","concurrently": false,"method": "btree","with": {}},- "user_connector_tools_user_id_idx": {- "name": "user_connector_tools_user_id_idx",+ "user_contact_requests_workspace_pending_unique": {+ "name": "user_contact_requests_workspace_pending_unique","columns": [{- "expression": "user_id",+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "requester_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "addressee_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"user_contact_requests\".\"status\" = 'pending' AND \"user_contact_requests\".\"workspace_id\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contact_requests_addressee_status_idx": {+ "name": "user_contact_requests_addressee_status_idx",+ "columns": [+ {+ "expression": "addressee_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status","isExpression": false,"asc": true,"nulls": "last"@@ -14221,11 +17688,17 @@"method": "btree","with": {}},- "user_connector_tools_connector_id_idx": {- "name": "user_connector_tools_connector_id_idx",+ "user_contact_requests_requester_status_idx": {+ "name": "user_contact_requests_requester_status_idx","columns": [{- "expression": "user_connector_id",+ "expression": "requester_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "status","isExpression": false,"asc": true,"nulls": "last"@@ -14236,8 +17709,8 @@"method": "btree","with": {}},- "user_connector_tools_workspace_id_idx": {- "name": "user_connector_tools_workspace_id_idx",+ "user_contact_requests_workspace_id_idx": {+ "name": "user_contact_requests_workspace_id_idx","columns": [{"expression": "workspace_id",@@ -14253,12 +17726,12 @@}},"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",+ "user_contact_requests_requester_id_users_id_fk": {+ "name": "user_contact_requests_requester_id_users_id_fk",+ "tableFrom": "user_contact_requests",+ "tableTo": "users","columnsFrom": [- "user_connector_id"+ "requester_id"],"columnsTo": ["id"@@ -14266,12 +17739,12 @@"onDelete": "cascade","onUpdate": "no action"},- "user_connector_tools_user_id_users_id_fk": {- "name": "user_connector_tools_user_id_users_id_fk",- "tableFrom": "user_connector_tools",+ "user_contact_requests_addressee_id_users_id_fk": {+ "name": "user_contact_requests_addressee_id_users_id_fk",+ "tableFrom": "user_contact_requests","tableTo": "users","columnsFrom": [- "user_id"+ "addressee_id"],"columnsTo": ["id"@@ -14279,9 +17752,9 @@"onDelete": "cascade","onUpdate": "no action"},- "user_connector_tools_workspace_id_workspaces_id_fk": {- "name": "user_connector_tools_workspace_id_workspaces_id_fk",- "tableFrom": "user_connector_tools",+ "user_contact_requests_workspace_id_workspaces_id_fk": {+ "name": "user_contact_requests_workspace_id_workspaces_id_fk",+ "tableFrom": "user_contact_requests","tableTo": "workspaces","columnsFrom": ["workspace_id"@@ -14296,11 +17769,16 @@"compositePrimaryKeys": {},"uniqueConstraints": {},"policies": {},- "checkConstraints": {},+ "checkConstraints": {+ "user_contact_requests_not_self_check": {+ "name": "user_contact_requests_not_self_check",+ "value": "\"user_contact_requests\".\"requester_id\" <> \"user_contact_requests\".\"addressee_id\""+ }+ },"isRLSEnabled": false},- "public.user_connectors": {- "name": "user_connectors",+ "public.user_contact_tag_assignments": {+ "name": "user_contact_tag_assignments","schema": "","columns": {"id": {@@ -14310,96 +17788,181 @@"notNull": true,"default": "gen_random_uuid()"},- "user_id": {- "name": "user_id",- "type": "text",+ "tag_id": {+ "name": "tag_id",+ "type": "uuid","primaryKey": false,"notNull": true},- "workspace_id": {- "name": "workspace_id",- "type": "text",+ "contact_id": {+ "name": "contact_id",+ "type": "uuid","primaryKey": false,- "notNull": false+ "notNull": true},- "agent_id": {- "name": "agent_id",+ "user_id": {+ "name": "user_id","type": "text","primaryKey": false,- "notNull": false- },- "identifier": {- "name": "identifier",- "type": "varchar(255)",- "primaryKey": false,"notNull": true},- "name": {- "name": "name",- "type": "varchar(255)",+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": true,+ "default": "now()"},- "source_type": {- "name": "source_type",- "type": "text",+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": true+ "notNull": true,+ "default": "now()"},- "mcp_server_url": {- "name": "mcp_server_url",- "type": "text",+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "user_contact_tag_assignments_tag_id_contact_id_unique": {+ "name": "user_contact_tag_assignments_tag_id_contact_id_unique",+ "columns": [+ {+ "expression": "tag_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "contact_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}},- "mcp_connection_type": {- "name": "mcp_connection_type",- "type": "text",- "primaryKey": false,- "notNull": false+ "user_contact_tag_assignments_contact_id_idx": {+ "name": "user_contact_tag_assignments_contact_id_idx",+ "columns": [+ {+ "expression": "contact_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}},- "mcp_stdio_config": {- "name": "mcp_stdio_config",- "type": "jsonb",- "primaryKey": false,- "notNull": false+ "user_contact_tag_assignments_user_id_idx": {+ "name": "user_contact_tag_assignments_user_id_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk": {+ "name": "user_contact_tag_assignments_tag_id_user_contact_tags_id_fk",+ "tableFrom": "user_contact_tag_assignments",+ "tableTo": "user_contact_tags",+ "columnsFrom": [+ "tag_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"},- "status": {- "name": "status",- "type": "text",- "primaryKey": false,- "notNull": true+ "user_contact_tag_assignments_contact_id_user_contacts_id_fk": {+ "name": "user_contact_tag_assignments_contact_id_user_contacts_id_fk",+ "tableFrom": "user_contact_tag_assignments",+ "tableTo": "user_contacts",+ "columnsFrom": [+ "contact_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"},- "is_enabled": {- "name": "is_enabled",- "type": "boolean",- "primaryKey": false,+ "user_contact_tag_assignments_user_id_users_id_fk": {+ "name": "user_contact_tag_assignments_user_id_users_id_fk",+ "tableFrom": "user_contact_tag_assignments",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.user_contact_tags": {+ "name": "user_contact_tags",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,"notNull": true,- "default": true+ "default": "gen_random_uuid()"},- "oidc_config": {- "name": "oidc_config",- "type": "jsonb",+ "user_id": {+ "name": "user_id",+ "type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "credentials": {- "name": "credentials",+ "name": {+ "name": "name","type": "text","primaryKey": false,- "notNull": false+ "notNull": true},- "token_expires_at": {- "name": "token_expires_at",- "type": "timestamp with time zone",+ "color": {+ "name": "color",+ "type": "text","primaryKey": false,"notNull": false},- "metadata": {- "name": "metadata",- "type": "jsonb",+ "sort_order": {+ "name": "sort_order",+ "type": "integer","primaryKey": false,- "notNull": false+ "notNull": true,+ "default": 0},"accessed_at": {"name": "accessed_at",@@ -14424,8 +17987,8 @@}},"indexes": {- "user_connectors_personal_identifier_idx": {- "name": "user_connectors_personal_identifier_idx",+ "user_contact_tags_user_id_name_unique": {+ "name": "user_contact_tags_user_id_name_unique","columns": [{"expression": "user_id",@@ -14434,20 +17997,129 @@"nulls": "last"},{- "expression": "identifier",+ "expression": "name","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,- "where": "\"user_connectors\".\"workspace_id\" IS NULL AND \"user_connectors\".\"agent_id\" IS NULL",+ "isUnique": true,"concurrently": false,"method": "btree","with": {}+ }+ },+ "foreignKeys": {+ "user_contact_tags_user_id_users_id_fk": {+ "name": "user_contact_tags_user_id_users_id_fk",+ "tableFrom": "user_contact_tags",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },+ "public.user_contacts": {+ "name": "user_contacts",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"},- "user_connectors_workspace_identifier_idx": {- "name": "user_connectors_workspace_identifier_idx",+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "contact_user_id": {+ "name": "contact_user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "remark": {+ "name": "remark",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "phones": {+ "name": "phones",+ "type": "text[]",+ "primaryKey": false,+ "notNull": false+ },+ "metadata": {+ "name": "metadata",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": false+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "user_contacts_user_unique": {+ "name": "user_contacts_user_unique","columns": [{"expression": "user_id",@@ -14455,6 +18127,22 @@"asc": true,"nulls": "last"},+ {+ "expression": "contact_user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "user_contacts_workspace_user_unique": {+ "name": "user_contacts_workspace_user_unique",+ "columns": [{"expression": "workspace_id","isExpression": false,@@ -14462,60 +18150,73 @@"nulls": "last"},{- "expression": "identifier",+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "contact_user_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,- "where": "\"user_connectors\".\"workspace_id\" IS NOT NULL AND \"user_connectors\".\"agent_id\" IS NULL",+ "isUnique": true,+ "where": "\"user_contacts\".\"contact_user_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "user_connectors_agent_identifier_idx": {- "name": "user_connectors_agent_identifier_idx",+ "user_contacts_agent_unique": {+ "name": "user_contacts_agent_unique","columns": [{- "expression": "agent_id",+ "expression": "user_id","isExpression": false,"asc": true,"nulls": "last"},{- "expression": "identifier",+ "expression": "agent_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,- "where": "\"user_connectors\".\"agent_id\" IS NOT NULL",+ "isUnique": true,+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NULL","concurrently": false,"method": "btree","with": {}},- "user_connectors_user_id_idx": {- "name": "user_connectors_user_id_idx",+ "user_contacts_workspace_agent_unique": {+ "name": "user_contacts_workspace_agent_unique","columns": [{- "expression": "user_id",+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "agent_id","isExpression": false,"asc": true,"nulls": "last"}],- "isUnique": false,+ "isUnique": true,+ "where": "\"user_contacts\".\"agent_id\" IS NOT NULL AND \"user_contacts\".\"workspace_id\" IS NOT NULL","concurrently": false,"method": "btree","with": {}},- "user_connectors_token_expires_at_idx": {- "name": "user_connectors_token_expires_at_idx",+ "user_contacts_contact_user_id_idx": {+ "name": "user_contacts_contact_user_id_idx","columns": [{- "expression": "token_expires_at",+ "expression": "contact_user_id","isExpression": false,"asc": true,"nulls": "last"@@ -14526,11 +18227,11 @@"method": "btree","with": {}},- "user_connectors_workspace_id_idx": {- "name": "user_connectors_workspace_id_idx",+ "user_contacts_agent_id_idx": {+ "name": "user_contacts_agent_id_idx","columns": [{- "expression": "workspace_id",+ "expression": "agent_id","isExpression": false,"asc": true,"nulls": "last"@@ -14541,11 +18242,11 @@"method": "btree","with": {}},- "user_connectors_agent_id_idx": {- "name": "user_connectors_agent_id_idx",+ "user_contacts_workspace_id_idx": {+ "name": "user_contacts_workspace_id_idx","columns": [{- "expression": "agent_id",+ "expression": "workspace_id","isExpression": false,"asc": true,"nulls": "last"@@ -14558,9 +18259,9 @@}},"foreignKeys": {- "user_connectors_user_id_users_id_fk": {- "name": "user_connectors_user_id_users_id_fk",- "tableFrom": "user_connectors",+ "user_contacts_user_id_users_id_fk": {+ "name": "user_contacts_user_id_users_id_fk",+ "tableFrom": "user_contacts","tableTo": "users","columnsFrom": ["user_id"@@ -14571,9 +18272,9 @@"onDelete": "cascade","onUpdate": "no action"},- "user_connectors_workspace_id_workspaces_id_fk": {- "name": "user_connectors_workspace_id_workspaces_id_fk",- "tableFrom": "user_connectors",+ "user_contacts_workspace_id_workspaces_id_fk": {+ "name": "user_contacts_workspace_id_workspaces_id_fk",+ "tableFrom": "user_contacts","tableTo": "workspaces","columnsFrom": ["workspace_id"@@ -14584,124 +18285,12 @@"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": "workspace_id",- "isExpression": false,- "asc": true,- "nulls": "last"- }- ],- "isUnique": false,- "concurrently": false,- "method": "btree",- "with": {}- }- },- "foreignKeys": {- "user_installed_plugins_user_id_users_id_fk": {- "name": "user_installed_plugins_user_id_users_id_fk",- "tableFrom": "user_installed_plugins",+ "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"+ "contact_user_id"],"columnsTo": ["id"@@ -14709,12 +18298,12 @@"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",- "tableTo": "workspaces",+ "user_contacts_agent_id_agents_id_fk": {+ "name": "user_contacts_agent_id_agents_id_fk",+ "tableFrom": "user_contacts",+ "tableTo": "agents","columnsFrom": [- "workspace_id"+ "agent_id"],"columnsTo": ["id"@@ -14723,15 +18312,7 @@"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": {},@@ -19613,6 +23194,12 @@"primaryKey": false,"notNull": false},+ "created_by_agent_id": {+ "name": "created_by_agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },"visibility": {"name": "visibility","type": "text",@@ -23986,6 +27573,358 @@"checkConstraints": {},"isRLSEnabled": false},+ "public.inbound_webhooks": {+ "name": "inbound_webhooks",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "uuid",+ "primaryKey": true,+ "notNull": true,+ "default": "gen_random_uuid()"+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "workspace_id": {+ "name": "workspace_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'pending'"+ },+ "agent_id": {+ "name": "agent_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "topic_id": {+ "name": "topic_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "instructions": {+ "name": "instructions",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "secret": {+ "name": "secret",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "verification": {+ "name": "verification",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "config": {+ "name": "config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "state": {+ "name": "state",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'::jsonb"+ },+ "connector_id": {+ "name": "connector_id",+ "type": "uuid",+ "primaryKey": false,+ "notNull": false+ },+ "dedupe_key": {+ "name": "dedupe_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "next_maintenance_at": {+ "name": "next_maintenance_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "maintenance_failures": {+ "name": "maintenance_failures",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "last_delivery_at": {+ "name": "last_delivery_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": false+ },+ "last_error": {+ "name": "last_error",+ "type": "text",+ "primaryKey": false,+ "notNull": false+ },+ "wake_count": {+ "name": "wake_count",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ },+ "wake_window_started_at": {+ "name": "wake_window_started_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "accessed_at": {+ "name": "accessed_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp with time zone",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "inbound_webhooks_user_kind_dedupe_unique": {+ "name": "inbound_webhooks_user_kind_dedupe_unique",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "kind",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "dedupe_key",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "where": "\"inbound_webhooks\".\"dedupe_key\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_next_maintenance_idx": {+ "name": "inbound_webhooks_next_maintenance_idx",+ "columns": [+ {+ "expression": "next_maintenance_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "where": "\"inbound_webhooks\".\"next_maintenance_at\" IS NOT NULL",+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_user_idx": {+ "name": "inbound_webhooks_user_idx",+ "columns": [+ {+ "expression": "user_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_workspace_idx": {+ "name": "inbound_webhooks_workspace_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_topic_idx": {+ "name": "inbound_webhooks_topic_idx",+ "columns": [+ {+ "expression": "topic_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_agent_idx": {+ "name": "inbound_webhooks_agent_idx",+ "columns": [+ {+ "expression": "agent_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "inbound_webhooks_connector_idx": {+ "name": "inbound_webhooks_connector_idx",+ "columns": [+ {+ "expression": "connector_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "inbound_webhooks_user_id_users_id_fk": {+ "name": "inbound_webhooks_user_id_users_id_fk",+ "tableFrom": "inbound_webhooks",+ "tableTo": "users",+ "columnsFrom": [+ "user_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "inbound_webhooks_workspace_id_workspaces_id_fk": {+ "name": "inbound_webhooks_workspace_id_workspaces_id_fk",+ "tableFrom": "inbound_webhooks",+ "tableTo": "workspaces",+ "columnsFrom": [+ "workspace_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "inbound_webhooks_agent_id_agents_id_fk": {+ "name": "inbound_webhooks_agent_id_agents_id_fk",+ "tableFrom": "inbound_webhooks",+ "tableTo": "agents",+ "columnsFrom": [+ "agent_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "inbound_webhooks_topic_id_topics_id_fk": {+ "name": "inbound_webhooks_topic_id_topics_id_fk",+ "tableFrom": "inbound_webhooks",+ "tableTo": "topics",+ "columnsFrom": [+ "topic_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "inbound_webhooks_connector_id_user_connectors_id_fk": {+ "name": "inbound_webhooks_connector_id_user_connectors_id_fk",+ "tableFrom": "inbound_webhooks",+ "tableTo": "user_connectors",+ "columnsFrom": [+ "connector_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "policies": {},+ "checkConstraints": {},+ "isRLSEnabled": false+ },"public.linear_connections": {"name": "linear_connections","schema": "",@@ -51608,6 +55547,13 @@"primaryKey": false,"notNull": false},+ "config": {+ "name": "config",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true,+ "default": "'{}'::jsonb"+ },"joined_at": {"name": "joined_at","type": "timestamp with time zone",diff --git a/packages/database/migrations/meta/_journal.json b/packages/database/migrations/meta/_journal.jsonindex fa9e480f827..a383420d31d 100644--- a/packages/database/migrations/meta/_journal.json+++ b/packages/database/migrations/meta/_journal.json@@ -1540,7 +1540,14 @@"when": 1794890771557,"tag": "0219_contacts_external_contacts","breakpoints": true+ },+ {+ "idx": 220,+ "version": "7",+ "when": 1794939107563,+ "tag": "0220_channel_sections",+ "breakpoints": true}],"version": "6"-}+}\ No newline at end of filediff --git a/packages/database/src/schemas/channel.ts b/packages/database/src/schemas/channel.tsindex 3c588c1b51c..0760e2d7da8 100644--- a/packages/database/src/schemas/channel.ts+++ b/packages/database/src/schemas/channel.ts@@ -136,6 +136,30 @@ export const channels = pgTable(],);+/**+ * A person's own sidebar section for organizing channels (Slack-style). Sections belong to one+ * person in one scope: channels are shared, so how each member files them is not a channel+ * property. Built-in sections (pinned, channels, direct messages) are derived, not stored.+ */+export const channelSections = pgTable(+ 'channel_sections',+ {+ id: uuid('id').defaultRandom().primaryKey().notNull(),+ userId: text('user_id')+ .references(() => users.id, { onDelete: 'cascade' })+ .notNull(),+ /** NULL for the personal scope. */+ workspaceId: text('workspace_id').references(() => workspaces.id, { onDelete: 'cascade' }),++ name: text('name').notNull(),+ sort: integer('sort'),+ collapsed: boolean('collapsed').notNull().default(false),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+ },+ (t) => [index('channel_sections_user_id_workspace_id_idx').on(t.userId, t.workspaceId)],+);+/*** People and Agents in a channel. Mentions, job participants, Thread followers and read* positions all reference this one member identity.@@ -157,6 +181,12 @@ export const channelMembers = pgTable(role: text('role').$type<ChannelMemberRole>(),/** Highest sequence this person has read in the main channel. */lastReadSequence: integer('last_read_sequence'),+ /** This person's sidebar section; NULL falls back to the built-in section. */+ sectionId: uuid('section_id').references(() => channelSections.id, { onDelete: 'set null' }),+ /** Pinned to the top of this person's sidebar. */+ pinned: boolean('pinned').notNull().default(false),+ /** Hidden from this person's sidebar until new activity reaches them. */+ hidden: boolean('hidden').notNull().default(false),/** When this person pinned the conversation atop their own list; NULL when not pinned. */pinnedAt: timestamptz('pinned_at'),@@ -181,6 +211,9 @@ export const channelMembers = pgTable(.on(t.channelId, t.userId).where(sql`${t.userId} IS NOT NULL`),index('channel_members_user_id_idx').on(t.userId),+ index('channel_members_section_id_idx')+ .on(t.sectionId)+ .where(sql`${t.sectionId} IS NOT NULL`),index('channel_members_agent_id_idx').on(t.agentId),// One constraint per rule, so a new actor type adds constraints instead of rewriting these.check('channel_members_actor_type_check', sql`${t.actorType} IN ('user', 'agent')`),@@ -202,6 +235,11 @@ export const channelMembers = pgTable('channel_members_agent_id_owner_check',sql`${t.agentId} IS NULL OR ${t.actorType} = 'agent'`,),+ // Sidebar placement is a person's view; Agent members have no sidebar.+ check(+ 'channel_members_section_id_owner_check',+ sql`${t.sectionId} IS NULL OR ${t.actorType} = 'user'`,+ ),check('channel_members_config_owner_check',sql`${t.config} IS NULL OR ${t.actorType} <> 'user'`,