Skip to content

Commit a72020d

Browse files
committed
fix: expand fixtures with 8 teams, 40 players, tournament rosters, and balanced wins
- Added 10 new players and 2 new teams (Shadow Vipers, Titan Guard) - Added tournament 4: Adria Championship with round robin groups + double elimination playoffs - Fixed systematic winner bias where odd-position teams always lost - Added tournament_team_roster entries for all tournaments (was only tournament 3) - Added map veto picks and player utility data for finished matches - Updated cleanup.sql to handle expanded fixture data
1 parent 28a3725 commit a72020d

2 files changed

Lines changed: 786 additions & 48 deletions

File tree

hasura/fixtures/cleanup.sql

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
-- Cleanup fixture data
22
-- Removes all fixture data inserted by fixtures.sql
3-
-- Fixture players use steam_ids 76561198000000001 through 76561198000000030
3+
-- Fixture players use steam_ids 76561198000000001 through 76561198000000040
44

55
DO $$
66
DECLARE
7-
fixture_steam_ids bigint[] := ARRAY(SELECT generate_series(76561198000000001::bigint, 76561198000000030::bigint));
7+
fixture_steam_ids bigint[] := ARRAY(SELECT generate_series(76561198000000001::bigint, 76561198000000040::bigint));
88
fixture_team_ids uuid[] := ARRAY[
99
'a0000000-0000-0000-0000-000000000001'::uuid,
1010
'a0000000-0000-0000-0000-000000000002'::uuid,
1111
'a0000000-0000-0000-0000-000000000003'::uuid,
1212
'a0000000-0000-0000-0000-000000000004'::uuid,
1313
'a0000000-0000-0000-0000-000000000005'::uuid,
14-
'a0000000-0000-0000-0000-000000000006'::uuid
14+
'a0000000-0000-0000-0000-000000000006'::uuid,
15+
'a0000000-0000-0000-0000-000000000007'::uuid,
16+
'a0000000-0000-0000-0000-000000000008'::uuid
1517
];
1618
fixture_tournament_ids uuid[] := ARRAY[
1719
'b0000000-0000-0000-0000-000000000001'::uuid,
1820
'b0000000-0000-0000-0000-000000000002'::uuid,
19-
'b0000000-0000-0000-0000-000000000003'::uuid
21+
'b0000000-0000-0000-0000-000000000003'::uuid,
22+
'b0000000-0000-0000-0000-000000000004'::uuid
2023
];
2124
match_ids uuid[];
2225
BEGIN
@@ -48,6 +51,7 @@ BEGIN
4851
ALTER TABLE matches DISABLE TRIGGER ALL;
4952
ALTER TABLE match_lineups DISABLE TRIGGER ALL;
5053
ALTER TABLE match_options DISABLE TRIGGER ALL;
54+
ALTER TABLE match_map_veto_picks DISABLE TRIGGER ALL;
5155

5256
-- Delete player event data
5357
DELETE FROM player_kills WHERE match_id = ANY(match_ids);
@@ -58,6 +62,9 @@ BEGIN
5862
DELETE FROM player_unused_utility WHERE match_id = ANY(match_ids);
5963
DELETE FROM player_utility WHERE match_id = ANY(match_ids);
6064

65+
-- Delete map veto picks
66+
DELETE FROM match_map_veto_picks WHERE match_id = ANY(match_ids);
67+
6168
-- Delete match map data
6269
DELETE FROM match_map_rounds WHERE match_map_id IN (
6370
SELECT id FROM match_maps WHERE match_id = ANY(match_ids)
@@ -104,6 +111,7 @@ BEGIN
104111
ALTER TABLE matches ENABLE TRIGGER ALL;
105112
ALTER TABLE match_lineups ENABLE TRIGGER ALL;
106113
ALTER TABLE match_options ENABLE TRIGGER ALL;
114+
ALTER TABLE match_map_veto_picks ENABLE TRIGGER ALL;
107115
END IF;
108116

109117
-- Delete tournament data

0 commit comments

Comments
 (0)