|
| 1 | +-- migration-safe: Metadata-only storage option; existing and new workers retain the same index and search semantics. |
| 2 | +ALTER INDEX "public"."emb_content_fts_idx" SET (fastupdate = off);--> statement-breakpoint |
| 3 | +-- Release the DDL lock before maintenance and index builds. Everything below is safe to replay after a partial migration. |
| 4 | +COMMIT;--> statement-breakpoint |
| 5 | +-- Disabling fastupdate does not flush existing pending entries. Drain them once without rebuilding the index. |
| 6 | +SET statement_timeout = '5min';--> statement-breakpoint |
| 7 | +SELECT pg_catalog.gin_clean_pending_list('"public"."emb_content_fts_idx"'::regclass);--> statement-breakpoint |
| 8 | +SET statement_timeout = 0;--> statement-breakpoint |
| 9 | +-- Indexes backing user and workspace delete actions, which otherwise scan these tables inside the deleting transaction. |
| 10 | +SET lock_timeout = 0;--> statement-breakpoint |
| 11 | +-- migration-safe: replay replaces only this new index to recover an interrupted concurrent build; existing indexes remain available. |
| 12 | +DROP INDEX CONCURRENTLY IF EXISTS "doc_uploaded_by_idx";--> statement-breakpoint |
| 13 | +CREATE INDEX CONCURRENTLY IF NOT EXISTS "doc_uploaded_by_idx" ON "document" USING btree ("uploaded_by") WHERE "document"."uploaded_by" IS NOT NULL;--> statement-breakpoint |
| 14 | +-- migration-safe: replay replaces only this new index to recover an interrupted concurrent build; existing indexes remain available. |
| 15 | +DROP INDEX CONCURRENTLY IF EXISTS "execution_large_values_workspace_id_idx";--> statement-breakpoint |
| 16 | +CREATE INDEX CONCURRENTLY IF NOT EXISTS "execution_large_values_workspace_id_idx" ON "execution_large_values" USING btree ("workspace_id");--> statement-breakpoint |
| 17 | +-- migration-safe: replay replaces only this new index to recover an interrupted concurrent build; existing indexes remain available. |
| 18 | +DROP INDEX CONCURRENTLY IF EXISTS "user_table_def_created_by_idx";--> statement-breakpoint |
| 19 | +CREATE INDEX CONCURRENTLY IF NOT EXISTS "user_table_def_created_by_idx" ON "user_table_definitions" USING btree ("created_by");--> statement-breakpoint |
| 20 | +-- migration-safe: replay replaces only this new index to recover an interrupted concurrent build; existing indexes remain available. |
| 21 | +DROP INDEX CONCURRENTLY IF EXISTS "user_table_rows_created_by_idx";--> statement-breakpoint |
| 22 | +CREATE INDEX CONCURRENTLY IF NOT EXISTS "user_table_rows_created_by_idx" ON "user_table_rows" USING btree ("created_by") WHERE "user_table_rows"."created_by" IS NOT NULL;--> statement-breakpoint |
| 23 | +SET lock_timeout = '5s'; |
0 commit comments