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
Epic #126 — Festival phases. PRD: docs/prd/festival-phases/3-post-festival.md.
What to build
The epic's single migration plus the Core-Team escape hatch for wrong derived phases. This ticket owns the one schema change for the whole epic — it adds both the set_ratings table (consumed later by #TBD-rating) and the phase-override column — and wires the override into the derivation seam so a delayed, cancelled, or mis-dated festival can be corrected.
One migration (in supabase/migrations/, timestamp-prefixed — do NOT run supabase db push / db reset):
Nullable phase_override column on the edition holding an optional forced phase (pre-schedule | planning | live | post-festival, or null). Null ⇒ use derived.
set_ratings table (created here so the rating ticket can build on it): one rating per (user_id, set_id) unique constraint, distinct from votes. RLS mirrors votes (a user manages their own; visibility follows the same rules votes use, incl. group context). Match what votes does rather than inventing a new policy shape.
Effective phase = override ?? derived — extend the getFestivalPhase seam (or its caller) from Festival phase: derivation core + useFestivalPhase hook #136 so a non-null override wins over every derived case and null falls through to the derived value. Keep this the single rule; do not scatter override checks across consumers.
Core-Team override control — a control in the edition admin area to set/clear the override, beside the existing ScheduleRevealControl under src/pages/admin/festivals/. Clearing returns the edition to automatic (derived) behavior.
The override is a minimal escape hatch (one optional forced phase), not a scheduling system.
Acceptance criteria
One migration adds the nullable phase_override column and the set_ratings table; set_ratings has a unique (user_id, set_id) constraint and RLS mirroring votes.
Parent
Epic #126 — Festival phases. PRD:
docs/prd/festival-phases/3-post-festival.md.What to build
The epic's single migration plus the Core-Team escape hatch for wrong derived phases. This ticket owns the one schema change for the whole epic — it adds both the
set_ratingstable (consumed later by #TBD-rating) and the phase-override column — and wires the override into the derivation seam so a delayed, cancelled, or mis-dated festival can be corrected.supabase/migrations/, timestamp-prefixed — do NOT runsupabase db push/db reset):phase_overridecolumn on the edition holding an optional forced phase (pre-schedule | planning | live | post-festival, or null). Null ⇒ use derived.set_ratingstable (created here so the rating ticket can build on it): one rating per(user_id, set_id)unique constraint, distinct fromvotes. RLS mirrorsvotes(a user manages their own; visibility follows the same rules votes use, incl. group context). Match whatvotesdoes rather than inventing a new policy shape.override ?? derived— extend thegetFestivalPhaseseam (or its caller) from Festival phase: derivation core + useFestivalPhase hook #136 so a non-null override wins over every derived case and null falls through to the derived value. Keep this the single rule; do not scatter override checks across consumers.ScheduleRevealControlundersrc/pages/admin/festivals/. Clearing returns the edition to automatic (derived) behavior.The override is a minimal escape hatch (one optional forced phase), not a scheduling system.
Acceptance criteria
phase_overridecolumn and theset_ratingstable;set_ratingshas a unique(user_id, set_id)constraint and RLS mirroringvotes.effective phase = override ?? derivedis unit-tested extending the Festival phase: derivation core + useFestivalPhase hook #136 seam: a non-null override wins over every derived case; null falls through to the derived value (nowinjected).supabase db push/db resetrun; migration is timestamp-prefixed insupabase/migrations/.Blocked by
useFestivalPhasehook (the seam the override extends).