You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
54
+
"chat_id" uuid NOT NULL,
55
+
"workflow_id"textNOT NULL,
56
+
"hash"textNOT NULL,
57
+
"created_at"timestamp DEFAULT now() NOT NULL,
58
+
"updated_at"timestamp DEFAULT now() NOT NULL
59
+
);
60
+
--> statement-breakpoint
61
+
ALTERTABLE"copilot_async_tool_calls" ADD CONSTRAINT"copilot_async_tool_calls_run_id_copilot_runs_id_fk"FOREIGN KEY ("run_id") REFERENCES"public"."copilot_runs"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
62
+
ALTERTABLE"copilot_async_tool_calls" ADD CONSTRAINT"copilot_async_tool_calls_checkpoint_id_copilot_run_checkpoints_id_fk"FOREIGN KEY ("checkpoint_id") REFERENCES"public"."copilot_run_checkpoints"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
63
+
ALTERTABLE"copilot_run_checkpoints" ADD CONSTRAINT"copilot_run_checkpoints_run_id_copilot_runs_id_fk"FOREIGN KEY ("run_id") REFERENCES"public"."copilot_runs"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
64
+
ALTERTABLE"copilot_runs" ADD CONSTRAINT"copilot_runs_chat_id_copilot_chats_id_fk"FOREIGN KEY ("chat_id") REFERENCES"public"."copilot_chats"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
65
+
ALTERTABLE"copilot_runs" ADD CONSTRAINT"copilot_runs_user_id_user_id_fk"FOREIGN KEY ("user_id") REFERENCES"public"."user"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
66
+
ALTERTABLE"copilot_runs" ADD CONSTRAINT"copilot_runs_workflow_id_workflow_id_fk"FOREIGN KEY ("workflow_id") REFERENCES"public"."workflow"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
67
+
ALTERTABLE"copilot_runs" ADD CONSTRAINT"copilot_runs_workspace_id_workspace_id_fk"FOREIGN KEY ("workspace_id") REFERENCES"public"."workspace"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
68
+
ALTERTABLE"copilot_workflow_read_hashes" ADD CONSTRAINT"copilot_workflow_read_hashes_chat_id_copilot_chats_id_fk"FOREIGN KEY ("chat_id") REFERENCES"public"."copilot_chats"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
69
+
ALTERTABLE"copilot_workflow_read_hashes" ADD CONSTRAINT"copilot_workflow_read_hashes_workflow_id_workflow_id_fk"FOREIGN KEY ("workflow_id") REFERENCES"public"."workflow"("id") ON DELETE cascadeONUPDATE no action;--> statement-breakpoint
70
+
CREATEINDEX "copilot_async_tool_calls_run_id_idx" ON"copilot_async_tool_calls" USING btree ("run_id");--> statement-breakpoint
71
+
CREATEINDEX "copilot_async_tool_calls_checkpoint_id_idx" ON"copilot_async_tool_calls" USING btree ("checkpoint_id");--> statement-breakpoint
72
+
CREATEINDEX "copilot_async_tool_calls_tool_call_id_idx" ON"copilot_async_tool_calls" USING btree ("tool_call_id");--> statement-breakpoint
73
+
CREATEINDEX "copilot_async_tool_calls_status_idx" ON"copilot_async_tool_calls" USING btree ("status");--> statement-breakpoint
74
+
CREATEINDEX "copilot_async_tool_calls_run_status_idx" ON"copilot_async_tool_calls" USING btree ("run_id","status");--> statement-breakpoint
75
+
CREATEUNIQUE INDEX "copilot_async_tool_calls_tool_call_id_unique" ON"copilot_async_tool_calls" USING btree ("tool_call_id");--> statement-breakpoint
76
+
CREATEINDEX "copilot_run_checkpoints_run_id_idx" ON"copilot_run_checkpoints" USING btree ("run_id");--> statement-breakpoint
77
+
CREATEINDEX "copilot_run_checkpoints_pending_tool_call_id_idx" ON"copilot_run_checkpoints" USING btree ("pending_tool_call_id");--> statement-breakpoint
78
+
CREATEUNIQUE INDEX "copilot_run_checkpoints_run_pending_tool_unique" ON"copilot_run_checkpoints" USING btree ("run_id","pending_tool_call_id");--> statement-breakpoint
79
+
CREATEINDEX "copilot_runs_execution_id_idx" ON"copilot_runs" USING btree ("execution_id");--> statement-breakpoint
80
+
CREATEINDEX "copilot_runs_parent_run_id_idx" ON"copilot_runs" USING btree ("parent_run_id");--> statement-breakpoint
81
+
CREATEINDEX "copilot_runs_chat_id_idx" ON"copilot_runs" USING btree ("chat_id");--> statement-breakpoint
82
+
CREATEINDEX "copilot_runs_user_id_idx" ON"copilot_runs" USING btree ("user_id");--> statement-breakpoint
83
+
CREATEINDEX "copilot_runs_workflow_id_idx" ON"copilot_runs" USING btree ("workflow_id");--> statement-breakpoint
84
+
CREATEINDEX "copilot_runs_workspace_id_idx" ON"copilot_runs" USING btree ("workspace_id");--> statement-breakpoint
85
+
CREATEINDEX "copilot_runs_status_idx" ON"copilot_runs" USING btree ("status");--> statement-breakpoint
86
+
CREATEINDEX "copilot_runs_chat_execution_idx" ON"copilot_runs" USING btree ("chat_id","execution_id");--> statement-breakpoint
87
+
CREATEINDEX "copilot_runs_execution_started_at_idx" ON"copilot_runs" USING btree ("execution_id","started_at");--> statement-breakpoint
88
+
CREATEUNIQUE INDEX "copilot_runs_stream_id_unique" ON"copilot_runs" USING btree ("stream_id");--> statement-breakpoint
89
+
CREATEINDEX "copilot_workflow_read_hashes_chat_id_idx" ON"copilot_workflow_read_hashes" USING btree ("chat_id");--> statement-breakpoint
90
+
CREATEINDEX "copilot_workflow_read_hashes_workflow_id_idx" ON"copilot_workflow_read_hashes" USING btree ("workflow_id");--> statement-breakpoint
91
+
CREATEUNIQUE INDEX "copilot_workflow_read_hashes_chat_workflow_unique" ON"copilot_workflow_read_hashes" USING btree ("chat_id","workflow_id");--> statement-breakpoint
92
+
CREATEUNIQUE INDEX "kb_workspace_name_active_unique" ON"knowledge_base" USING btree ("workspace_id","name") WHERE"knowledge_base"."deleted_at" IS NULL;--> statement-breakpoint
93
+
CREATEUNIQUE INDEX "workspace_files_workspace_name_active_unique" ON"workspace_files" USING btree ("workspace_id","original_name") WHERE"workspace_files"."deleted_at" IS NULLAND"workspace_files"."context"='workspace'AND"workspace_files"."workspace_id"IS NOT NULL;
0 commit comments