diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-18 22:38:15 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-18 22:38:15 +0900 |
| commit | 9f9efc2bc07810d2e06b37bad94e5922681eadef (patch) | |
| tree | 79bcce2bf065a7ea282aa7855822c3bdee92ee7c /backend/fixtures/dev.sql | |
| parent | c095200dc79f24c0cd17a2e3ba15c85a2971ea9a (diff) | |
| download | phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.gz phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.zst phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.zip | |
feat: refactor tournament to generic DB-backed N-person bracket
Replace hardcoded 6-person tournament with a generic single-elimination
bracket system backed by new DB tables (tournaments, tournament_entries,
tournament_matches). Includes admin CRUD, standard seeding algorithm,
bye handling, and a CSS Grid bracket renderer on the frontend.
Add comprehensive tests for backend API/admin handlers, seeding logic,
and frontend bracket component.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/fixtures/dev.sql')
| -rw-r--r-- | backend/fixtures/dev.sql | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/backend/fixtures/dev.sql b/backend/fixtures/dev.sql index bc25011..2876456 100644 --- a/backend/fixtures/dev.sql +++ b/backend/fixtures/dev.sql @@ -44,3 +44,25 @@ VALUES (5, '', '42'), (6, '', '42'), (7, '', '42'); + +-- Tournament: 3 participants, bracket_size=4, num_rounds=2 +INSERT INTO tournaments +(display_name, bracket_size, num_rounds) +VALUES + ('TEST Tournament', 4, 2); + +-- Entries: 3 players with seeds 1-3 (seed 4 = bye) +INSERT INTO tournament_entries +(tournament_id, user_id, seed) +VALUES + (1, 1, 1), + (1, 2, 2), + (1, 3, 3); + +-- Matches: Round 0 has 2 matches, Round 1 has 1 match (final) +INSERT INTO tournament_matches +(tournament_id, round, position, game_id) +VALUES + (1, 0, 0, 1), + (1, 0, 1, 2), + (1, 1, 0, 3); |
