Summary
supabase/migrations/060_marketplace_kind.sql adds a check constraint without an existence guard:
ALTER TABLE public.marketplace_listings
ADD CONSTRAINT marketplace_listings_kind_check CHECK (kind IN ('rubric', 'test', 'deck')) NOT VALID;
Every other statement in this migration (and the surrounding convention across the codebase) is IF NOT EXISTS-guarded, but ADD CONSTRAINT has no such form. Since supabase/bootstrap.sql is a full mechanical concatenation of every migration (see scripts/generate-bootstrap.sh), a second psql -f supabase/bootstrap.sql run against an already-bootstrapped database raises 42710 (constraint already exists) and aborts the rest of the script.
Found while regenerating bootstrap.sql for PR #346 — the migration itself is already merged and unrelated to that PR's actual changes, so it wasn't fixed there per this repo's rule of never modifying an already-applied migration.
Suggested fix
A new forward-only migration:
ALTER TABLE public.marketplace_listings
DROP CONSTRAINT IF EXISTS marketplace_listings_kind_check;
ALTER TABLE public.marketplace_listings
ADD CONSTRAINT marketplace_listings_kind_check CHECK (kind IN ('rubric', 'test', 'deck')) NOT VALID;
ALTER TABLE public.marketplace_listings
VALIDATE CONSTRAINT marketplace_listings_kind_check;
Then regenerate bootstrap.sql via ./scripts/generate-bootstrap.sh.
🤖 Found via Claude Code / CodeRabbit review on PR #346.
Summary
supabase/migrations/060_marketplace_kind.sqladds a check constraint without an existence guard:Every other statement in this migration (and the surrounding convention across the codebase) is
IF NOT EXISTS-guarded, butADD CONSTRAINThas no such form. Sincesupabase/bootstrap.sqlis a full mechanical concatenation of every migration (seescripts/generate-bootstrap.sh), a secondpsql -f supabase/bootstrap.sqlrun against an already-bootstrapped database raises42710(constraint already exists) and aborts the rest of the script.Found while regenerating
bootstrap.sqlfor PR #346 — the migration itself is already merged and unrelated to that PR's actual changes, so it wasn't fixed there per this repo's rule of never modifying an already-applied migration.Suggested fix
A new forward-only migration:
Then regenerate
bootstrap.sqlvia./scripts/generate-bootstrap.sh.🤖 Found via Claude Code / CodeRabbit review on PR #346.