@rudderhq/db 0.4.5 → 0.4.6-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ ALTER TABLE "instance_settings" ADD COLUMN "browser" jsonb DEFAULT '{}'::jsonb NOT NULL;
@@ -0,0 +1,30 @@
1
+ CREATE TABLE "chat_work_manifest_items" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "org_id" uuid NOT NULL,
4
+ "conversation_id" uuid NOT NULL,
5
+ "project_id" uuid,
6
+ "message_id" uuid,
7
+ "run_id" uuid,
8
+ "category" text NOT NULL,
9
+ "target_type" text NOT NULL,
10
+ "target_key" text NOT NULL,
11
+ "title" text NOT NULL,
12
+ "url" text,
13
+ "status" text DEFAULT 'ready' NOT NULL,
14
+ "source_role" text,
15
+ "created_by_agent_id" uuid,
16
+ "created_by_user_id" text,
17
+ "metadata" jsonb,
18
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
19
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
20
+ );
21
+ --> statement-breakpoint
22
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_org_id_organizations_id_fk" FOREIGN KEY ("org_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
23
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_conversation_id_chat_conversations_id_fk" FOREIGN KEY ("conversation_id") REFERENCES "public"."chat_conversations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
24
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
25
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_message_id_chat_messages_id_fk" FOREIGN KEY ("message_id") REFERENCES "public"."chat_messages"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
26
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_run_id_heartbeat_runs_id_fk" FOREIGN KEY ("run_id") REFERENCES "public"."heartbeat_runs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
27
+ ALTER TABLE "chat_work_manifest_items" ADD CONSTRAINT "chat_work_manifest_items_created_by_agent_id_agents_id_fk" FOREIGN KEY ("created_by_agent_id") REFERENCES "public"."agents"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
28
+ CREATE UNIQUE INDEX "chat_work_manifest_items_conversation_target_uq" ON "chat_work_manifest_items" USING btree ("conversation_id","target_key");--> statement-breakpoint
29
+ CREATE INDEX "chat_work_manifest_items_org_conversation_category_idx" ON "chat_work_manifest_items" USING btree ("org_id","conversation_id","category");--> statement-breakpoint
30
+ CREATE INDEX "chat_work_manifest_items_org_project_category_idx" ON "chat_work_manifest_items" USING btree ("org_id","project_id","category");