Skip to content

Commit 1ade3bf

Browse files
fix migration
1 parent 18b3f24 commit 1ade3bf

File tree

4 files changed

+15771
-390
lines changed

4 files changed

+15771
-390
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
DROP INDEX "chat_archived_at_idx";--> statement-breakpoint
2+
DROP INDEX "doc_archived_at_idx";--> statement-breakpoint
3+
DROP INDEX "doc_deleted_at_idx";--> statement-breakpoint
4+
DROP INDEX "form_archived_at_idx";--> statement-breakpoint
5+
DROP INDEX "kc_archived_at_idx";--> statement-breakpoint
6+
DROP INDEX "kc_deleted_at_idx";--> statement-breakpoint
7+
DROP INDEX "mcp_servers_workspace_deleted_idx";--> statement-breakpoint
8+
DROP INDEX "webhook_archived_at_idx";--> statement-breakpoint
9+
DROP INDEX "workflow_mcp_tool_archived_at_idx";--> statement-breakpoint
10+
DROP INDEX "workflow_schedule_archived_at_idx";--> statement-breakpoint
11+
ALTER TABLE "workspace" ADD COLUMN "log_retention_hours" integer;--> statement-breakpoint
12+
ALTER TABLE "workspace" ADD COLUMN "soft_delete_retention_hours" integer;--> statement-breakpoint
13+
ALTER TABLE "workspace" ADD COLUMN "task_cleanup_hours" integer;--> statement-breakpoint
14+
CREATE INDEX "a2a_agent_workspace_archived_partial_idx" ON "a2a_agent" USING btree ("workspace_id","archived_at") WHERE "a2a_agent"."archived_at" IS NOT NULL;--> statement-breakpoint
15+
CREATE INDEX "chat_archived_at_partial_idx" ON "chat" USING btree ("archived_at") WHERE "chat"."archived_at" IS NOT NULL;--> statement-breakpoint
16+
CREATE INDEX "doc_archived_at_partial_idx" ON "document" USING btree ("archived_at") WHERE "document"."archived_at" IS NOT NULL;--> statement-breakpoint
17+
CREATE INDEX "doc_deleted_at_partial_idx" ON "document" USING btree ("deleted_at") WHERE "document"."deleted_at" IS NOT NULL;--> statement-breakpoint
18+
CREATE INDEX "form_archived_at_partial_idx" ON "form" USING btree ("archived_at") WHERE "form"."archived_at" IS NOT NULL;--> statement-breakpoint
19+
CREATE INDEX "kb_workspace_deleted_partial_idx" ON "knowledge_base" USING btree ("workspace_id","deleted_at") WHERE "knowledge_base"."deleted_at" IS NOT NULL;--> statement-breakpoint
20+
CREATE INDEX "kc_archived_at_partial_idx" ON "knowledge_connector" USING btree ("archived_at") WHERE "knowledge_connector"."archived_at" IS NOT NULL;--> statement-breakpoint
21+
CREATE INDEX "kc_deleted_at_partial_idx" ON "knowledge_connector" USING btree ("deleted_at") WHERE "knowledge_connector"."deleted_at" IS NOT NULL;--> statement-breakpoint
22+
CREATE INDEX "mcp_servers_workspace_deleted_partial_idx" ON "mcp_servers" USING btree ("workspace_id","deleted_at") WHERE "mcp_servers"."deleted_at" IS NOT NULL;--> statement-breakpoint
23+
CREATE INDEX "memory_workspace_deleted_partial_idx" ON "memory" USING btree ("workspace_id","deleted_at") WHERE "memory"."deleted_at" IS NOT NULL;--> statement-breakpoint
24+
CREATE INDEX "usage_log_workspace_created_at_idx" ON "usage_log" USING btree ("workspace_id","created_at");--> statement-breakpoint
25+
CREATE INDEX "user_table_def_workspace_archived_partial_idx" ON "user_table_definitions" USING btree ("workspace_id","archived_at") WHERE "user_table_definitions"."archived_at" IS NOT NULL;--> statement-breakpoint
26+
CREATE INDEX "webhook_archived_at_partial_idx" ON "webhook" USING btree ("archived_at") WHERE "webhook"."archived_at" IS NOT NULL;--> statement-breakpoint
27+
CREATE INDEX "workflow_workspace_archived_partial_idx" ON "workflow" USING btree ("workspace_id","archived_at") WHERE "workflow"."archived_at" IS NOT NULL;--> statement-breakpoint
28+
CREATE INDEX "workflow_folder_workspace_archived_partial_idx" ON "workflow_folder" USING btree ("workspace_id","archived_at") WHERE "workflow_folder"."archived_at" IS NOT NULL;--> statement-breakpoint
29+
CREATE INDEX "workflow_mcp_server_workspace_deleted_partial_idx" ON "workflow_mcp_server" USING btree ("workspace_id","deleted_at") WHERE "workflow_mcp_server"."deleted_at" IS NOT NULL;--> statement-breakpoint
30+
CREATE INDEX "workflow_mcp_tool_archived_at_partial_idx" ON "workflow_mcp_tool" USING btree ("archived_at") WHERE "workflow_mcp_tool"."archived_at" IS NOT NULL;--> statement-breakpoint
31+
CREATE INDEX "workflow_schedule_archived_at_partial_idx" ON "workflow_schedule" USING btree ("archived_at") WHERE "workflow_schedule"."archived_at" IS NOT NULL;--> statement-breakpoint
32+
CREATE INDEX "workspace_file_workspace_deleted_partial_idx" ON "workspace_file" USING btree ("workspace_id","deleted_at") WHERE "workspace_file"."deleted_at" IS NOT NULL;--> statement-breakpoint
33+
CREATE INDEX "workspace_files_workspace_deleted_partial_idx" ON "workspace_files" USING btree ("workspace_id","deleted_at") WHERE "workspace_files"."deleted_at" IS NOT NULL;

0 commit comments

Comments
 (0)