Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions packages/db/migrations/0287_workflow_blocks_error_enabled.sql
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,12 +11,4 @@ ALTER TABLE "workflow_blocks" ADD COLUMN "error_enabled" boolean DEFAULT false N
UPDATE "workflow_blocks" AS b
SET "error_enabled" = true
FROM "workflow_edges" AS e
WHERE e."source_block_id" = b."id" AND e."source_handle" = 'error';--> statement-breakpoint
-- The flag also briefly persisted inside `data` on this unmerged branch and never
-- reached production. These move any row a developer created onto the column and
-- leave the value one home, so a block saved before the change stops differing
-- from one saved after it. Both match zero rows on a database that never saw the key.
-- migration-safe: idempotent (re-running sets the same value and removes an already-absent key); the key is written by no released version, so no concurrent writer can reintroduce it.
UPDATE "workflow_blocks" SET "error_enabled" = true WHERE "data" ->> 'errorEnabled' = 'true';--> statement-breakpoint
-- migration-safe: idempotent (re-running removes an already-absent key); the key is written by no released version, so no concurrent writer can reintroduce it.
UPDATE "workflow_blocks" SET "data" = "data" - 'errorEnabled' WHERE "data" ->> 'errorEnabled' IS NOT NULL;
WHERE e."source_block_id" = b."id" AND e."source_handle" = 'error';
Loading