fix(playback): freeze v3 seek reanchor recipes (#548)

* fix(playback): freeze v3 seek reanchor recipes

* fix(playback): address v3 recipe review feedback

* test(playback): isolate v3 fallback route fixture

* fix(database): split v3 recipe constraint validation

* fix(playback): preserve frozen seek recipe identity

---------

Co-authored-by: Quick104 <31828688+Quick104@users.noreply.github.com>
This commit is contained in:
Suspense
2026-08-06 10:43:21 -04:00
committed by GitHub
co-authored by Quick104
parent 40a9de7f26
commit fa1d7ba2b4
17 changed files with 1412 additions and 122 deletions
@@ -0,0 +1,12 @@
-- +goose Up
ALTER TABLE playback_v3_attempts
ADD COLUMN frozen_recipe JSONB NOT NULL DEFAULT '{}'::jsonb;
ALTER TABLE playback_v3_attempts
ADD CONSTRAINT playback_v3_attempts_frozen_recipe_object
CHECK (jsonb_typeof(frozen_recipe) = 'object') NOT VALID;
-- +goose Down
ALTER TABLE playback_v3_attempts
DROP CONSTRAINT IF EXISTS playback_v3_attempts_frozen_recipe_object,
DROP COLUMN IF EXISTS frozen_recipe;
@@ -0,0 +1,8 @@
-- +goose Up
ALTER TABLE playback_v3_attempts
VALIDATE CONSTRAINT playback_v3_attempts_frozen_recipe_object;
-- +goose Down
-- PostgreSQL cannot mark a validated CHECK constraint NOT VALID again. The
-- preceding migration's Down step drops the constraint with its column.
SELECT 1;