• Mahmoud Aglan's avatar
    feat(db): the big-tournament hosting schema (P0) · 873278e4
    Mahmoud Aglan authored
    One idempotent migration for every hosting package: stages carry their own
    rounds, teams, team matches and stage entries, playable brackets, check-in,
    waitlist, registration forms and answers, prize categories and a prize hold,
    presentation (media, sponsors, ad slots, announcements), disputes,
    certificates, notices, forbidden pairs, tournament columns on the backgammon,
    domino and ludo tables, and club and lobby groups. Two storage buckets:
    tournament-media (public) and tournament-uploads (private).
    
    The 21 tournament tables keep RLS on with the service role only: anon and
    authenticated hold no grant at all (they read nothing there today; RLS had
    no policy for them). el3ab_tournaments and el3ab_tournament_rounds keep the
    read policies Realtime needs.
    
    Applied to production on 2026-10-26 after a backup in
    /root/backups/2026-10-27-hosting-schema/, then run a second time: the schema
    dumps before and after the second run are identical, and the 9 tournaments,
    16 registrations and 39 rounds are unchanged (the 4 legacy string pairings
    hold objects, so none was unwrapped). A commented rollback block is at the end
    of the file, tested inside BEGIN/ROLLBACK on production.
    
    Departures from the spec, each recorded in docs/tournament-hosting-contract.md:
    'unpaired' rounds stay legal only for the old Swiss service, a team event must
    have a team size, dispute_window_minutes gets a column, groups get kind and
    tournament_id.
    Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
    873278e4
Name
Last commit
Last update
..
2026-10-19-award-coins-type.sql Loading commit data...
2026-10-19-backgammon-online.sql Loading commit data...
2026-10-19-ludo-queue-player-count.sql Loading commit data...
2026-10-25-complete-match-level.sql Loading commit data...
2026-10-25-domino-tables.sql Loading commit data...
2026-10-25-ghost-profiles.sql Loading commit data...
2026-10-25-group-chat-privacy.sql Loading commit data...
2026-10-25-match-invites.sql Loading commit data...
2026-10-25-match-presence.sql Loading commit data...
2026-10-25-social.sql Loading commit data...
2026-10-26-ad-tracking.sql Loading commit data...
2026-10-26-complete-match-results.sql Loading commit data...
2026-10-26-game-config-keys.sql Loading commit data...
2026-10-26-manager-columns.sql Loading commit data...
2026-10-26-manager-orgs.sql Loading commit data...
2026-10-26-org-player-api.sql Loading commit data...
2026-10-26-org-unify.sql Loading commit data...
2026-10-26-profiles-guard.sql Loading commit data...
2026-10-26-redeem-followups.sql Loading commit data...
2026-10-26-redeem-functions.sql Loading commit data...
2026-10-26-redeem-tournament-reasons.sql Loading commit data...
2026-10-26-redeem.sql Loading commit data...
2026-10-26-season-progress.sql Loading commit data...
2026-10-26-security-lockdown.sql Loading commit data...
2026-10-26-tournament-economy.sql Loading commit data...
2026-10-26-tournament-rounds-rls.sql Loading commit data...
2026-10-27-hosting-schema.sql Loading commit data...
2026-10-27-test-accounts.sql Loading commit data...