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
{{ message }}
Repository navigation
Commit 3ca60d2
Browse filesBrowse the repository at this point in the historyBrowse files
-- migration-safe: tune the append-only ledger's vacuum thresholds without changing row data or query semantics.
1
+
-- migration-safe: tune the append-heavy ledger's vacuum thresholds without changing row data or query semantics.
2
2
ALTER TABLE "usage_log" SET (autovacuum_vacuum_insert_scale_factor = 0.01, autovacuum_analyze_scale_factor = 0.01);--> statement-breakpoint
3
3
-- 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
-
DROP INDEX CONCURRENTLY IF EXISTS "doc_active_kb_filename_idx";--> statement-breakpoint
8
-
CREATE INDEX CONCURRENTLY 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 NULL AND "document"."deleted_at" IS NULL;--> statement-breakpoint
9
-
-- migration-safe: replay removes an invalid build created by this migration; concurrent operations preserve writes.
10
-
DROP INDEX CONCURRENTLY IF EXISTS "folder_active_workspace_resource_sort_idx";--> statement-breakpoint
11
-
CREATE INDEX CONCURRENTLY 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
+
DROP INDEX CONCURRENTLY IF EXISTS "doc_active_kb_token_count_idx";--> statement-breakpoint
8
+
CREATE INDEX CONCURRENTLY 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 NULL AND "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
DROP INDEX CONCURRENTLY IF EXISTS "kcsl_connector_started_at_idx";--> statement-breakpoint
14
11
CREATE INDEX CONCURRENTLY 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
DROP INDEX CONCURRENTLY IF EXISTS "workflow_active_workspace_sort_idx";--> statement-breakpoint
20
17
CREATE INDEX CONCURRENTLY 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
-
DROP INDEX CONCURRENTLY IF EXISTS "workflow_active_workspace_folder_sort_idx";--> statement-breakpoint
23
-
CREATE INDEX CONCURRENTLY 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
-
DROP INDEX CONCURRENTLY IF EXISTS "workflow_execution_logs_workflow_started_at_id_idx";--> statement-breakpoint
26
-
CREATE INDEX CONCURRENTLY 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
DROP INDEX CONCURRENTLY IF EXISTS "academy_certificate_number_idx";--> statement-breakpoint
29
20
DROP INDEX CONCURRENTLY IF EXISTS "copilot_async_tool_calls_tool_call_id_idx";--> statement-breakpoint
30
21
DROP INDEX CONCURRENTLY IF EXISTS "mothership_settings_workspace_id_idx";--> statement-breakpoint
31
22
DROP INDEX CONCURRENTLY IF EXISTS "permissions_user_entity_idx";--> statement-breakpoint
32
23
DROP INDEX CONCURRENTLY IF EXISTS "session_token_idx";--> statement-breakpoint
33
24
DROP INDEX 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
+
DROP INDEX CONCURRENTLY IF EXISTS "kcsl_connector_id_idx";--> statement-breakpoint
0 commit comments