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
ALTERTABLE"paused_executions" ADD COLUMN IF NOT EXISTS "automatic_resume_retry_count"integer DEFAULT 0NOT NULL;--> statement-breakpoint
2
+
ALTERTABLE"workspace" ADD COLUMN IF NOT EXISTS "storage_used_bytes"bigint DEFAULT 0NOT NULL;--> statement-breakpoint
3
+
ALTERTABLE"workspace" ADD COLUMN IF NOT EXISTS "organization_assigned_at"timestamp;--> statement-breakpoint
4
+
-- migration-safe: replay-only cleanup of the constraint this same migration adds on the next line; no deployed code knows it yet. A failed concurrent index build below leaves this file unjournaled, and the rerun must not fail on ADD CONSTRAINT already-exists.
5
+
ALTERTABLE"workspace" DROP CONSTRAINT IF EXISTS "workspace_storage_used_bytes_non_negative";--> statement-breakpoint
6
+
ALTERTABLE"workspace" ADD CONSTRAINT"workspace_storage_used_bytes_non_negative"CHECK ("workspace"."storage_used_bytes">=0) NOT VALID;--> statement-breakpoint
7
+
8
+
-- These tables are live and potentially large. End the migration transaction
9
+
-- before building their indexes so writes remain available during deployment.
10
+
-- Every statement in this file is idempotent, so a failed concurrent build
11
+
-- (which leaves this migration unjournaled and an INVALID same-name index
12
+
-- behind) replays safely from the top: the drop clears any INVALID leftover
13
+
-- before each rebuild.
14
+
COMMIT;--> statement-breakpoint
15
+
SET lock_timeout =0;--> statement-breakpoint
16
+
DROPINDEX CONCURRENTLY IF EXISTS "copilot_messages_user_created_at_idx";--> statement-breakpoint
17
+
CREATEINDEXCONCURRENTLY IF NOT EXISTS "copilot_messages_user_created_at_idx"ON"copilot_messages" USING btree ("created_at","chat_id","message_id") WHERE"copilot_messages"."role"='user'AND"copilot_messages"."deleted_at" IS NULL;--> statement-breakpoint
18
+
DROPINDEX CONCURRENTLY IF EXISTS "outbox_event_type_created_idx";--> statement-breakpoint
19
+
CREATEINDEXCONCURRENTLY IF NOT EXISTS "outbox_event_type_created_idx"ON"outbox_event" USING btree ("event_type","created_at");--> statement-breakpoint
20
+
DROPINDEX CONCURRENTLY IF EXISTS "workflow_execution_logs_completed_ended_at_idx";--> statement-breakpoint
21
+
CREATEINDEXCONCURRENTLY IF NOT EXISTS "workflow_execution_logs_completed_ended_at_idx"ON"workflow_execution_logs" USING btree ("ended_at","workspace_id","execution_id") WHERE"workflow_execution_logs"."status"='completed'AND"workflow_execution_logs"."level"='info'AND"workflow_execution_logs"."ended_at"IS NOT NULL;--> statement-breakpoint
0 commit comments