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
-- Concurrent index operations cannot run inside the migration runner's transaction.
4
4
COMMIT;--> statement-breakpoint
5
5
SET lock_timeout =0;--> statement-breakpoint
6
6
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
7
-
DROPINDEX CONCURRENTLY IF EXISTS "doc_active_kb_filename_idx";--> statement-breakpoint
8
-
CREATEINDEXCONCURRENTLY IF NOT EXISTS "doc_active_kb_filename_idx"ON"document" USING btree ("knowledge_base_id","filename","uploaded_at"DESC,"token_count") WHERE"document"."user_excluded"= false AND"document"."archived_at" IS NULLAND"document"."deleted_at" IS NULL;--> statement-breakpoint
9
-
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
10
-
DROPINDEX CONCURRENTLY IF EXISTS "folder_active_workspace_resource_sort_idx";--> statement-breakpoint
11
-
CREATEINDEXCONCURRENTLY IF NOT EXISTS "folder_active_workspace_resource_sort_idx"ON"folder" USING btree ("workspace_id","resource_type","sort_order","created_at") WHERE"folder"."deleted_at" IS NULL;--> statement-breakpoint
12
-
-- migration-safe: the existing connector_id index remains available while this ordered replacement expands.
7
+
DROPINDEX CONCURRENTLY IF EXISTS "doc_active_kb_token_count_idx";--> statement-breakpoint
8
+
CREATEINDEXCONCURRENTLY IF NOT EXISTS "doc_active_kb_token_count_idx"ON"document" USING btree ("knowledge_base_id","token_count") WHERE"document"."user_excluded"= false AND"document"."archived_at" IS NULLAND"document"."deleted_at" IS NULL;--> statement-breakpoint
9
+
-- migration-safe: the existing connector_id index remains available until the ordered replacement is valid.
13
10
DROPINDEX CONCURRENTLY IF EXISTS "kcsl_connector_started_at_idx";--> statement-breakpoint
14
11
CREATEINDEXCONCURRENTLY IF NOT EXISTS "kcsl_connector_started_at_idx"ON"knowledge_connector_sync_log" USING btree ("connector_id","started_at"DESC);--> statement-breakpoint
15
12
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
@@ -18,17 +15,13 @@ CREATE INDEX CONCURRENTLY IF NOT EXISTS "table_views_workspace_created_idx" ON "
18
15
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
19
16
DROPINDEX CONCURRENTLY IF EXISTS "workflow_active_workspace_sort_idx";--> statement-breakpoint
20
17
CREATEINDEXCONCURRENTLY IF NOT EXISTS "workflow_active_workspace_sort_idx"ON"workflow" USING btree ("workspace_id","sort_order","created_at","id") WHERE"workflow"."archived_at" IS NULL;--> statement-breakpoint
21
-
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
22
-
DROPINDEX CONCURRENTLY IF EXISTS "workflow_active_workspace_folder_sort_idx";--> statement-breakpoint
23
-
CREATEINDEXCONCURRENTLY IF NOT EXISTS "workflow_active_workspace_folder_sort_idx"ON"workflow" USING btree ("workspace_id","folder_id","sort_order","created_at","id") WHERE"workflow"."archived_at" IS NULL;--> statement-breakpoint
24
-
-- migration-safe: the existing workflow/time index remains available while the keyset replacement expands.
25
-
DROPINDEX CONCURRENTLY IF EXISTS "workflow_execution_logs_workflow_started_at_id_idx";--> statement-breakpoint
26
-
CREATEINDEXCONCURRENTLY IF NOT EXISTS "workflow_execution_logs_workflow_started_at_id_idx"ON"workflow_execution_logs" USING btree ("workflow_id","started_at","id");--> statement-breakpoint
27
-
-- migration-safe: each removed index duplicates a primary or unique index with the identical leading key.
18
+
-- migration-safe: each removed index duplicates a primary or unique index with the identical key definition.
28
19
DROPINDEX CONCURRENTLY IF EXISTS "academy_certificate_number_idx";--> statement-breakpoint
29
20
DROPINDEX CONCURRENTLY IF EXISTS "copilot_async_tool_calls_tool_call_id_idx";--> statement-breakpoint
30
21
DROPINDEX CONCURRENTLY IF EXISTS "mothership_settings_workspace_id_idx";--> statement-breakpoint
31
22
DROPINDEX CONCURRENTLY IF EXISTS "permissions_user_entity_idx";--> statement-breakpoint
32
23
DROPINDEX CONCURRENTLY IF EXISTS "session_token_idx";--> statement-breakpoint
33
24
DROPINDEX CONCURRENTLY IF EXISTS "workspace_file_key_idx";--> statement-breakpoint
25
+
-- migration-safe: the valid ordered connector index covers the old index's complete key definition.
26
+
DROPINDEX CONCURRENTLY IF EXISTS "kcsl_connector_id_idx";--> statement-breakpoint
0 commit comments