diff --git a/packages/db/migrations/0287_workflow_blocks_error_enabled.sql b/packages/db/migrations/0287_workflow_blocks_error_enabled.sql index d6839cc66f9..951ad0cb8f2 100644 --- a/packages/db/migrations/0287_workflow_blocks_error_enabled.sql +++ b/packages/db/migrations/0287_workflow_blocks_error_enabled.sql @@ -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';