Skip to content

Commit c8184a1

Browse files
committed
fix: add missing group and path columns to tournament fixture brackets
Tournament brackets for tournaments 1 and 2 were missing the "group" and "path" columns, causing NULL values. The frontend computes maxGroups via Math.max() on null values which returns 0, so the bracket v-for loop iterates zero times and nothing renders.
1 parent 67c4aa9 commit c8184a1

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

hasura/fixtures/fixtures.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,11 @@ BEGIN
766766
END LOOP;
767767

768768
-- Create brackets (semifinals + final)
769-
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, finished)
769+
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, "group", path, finished)
770770
VALUES
771-
(t1_bracket_sf1, t1_stage_id, t1_team_ids[1], t1_team_ids[4], 1, 1, true),
772-
(t1_bracket_sf2, t1_stage_id, t1_team_ids[2], t1_team_ids[3], 1, 2, true),
773-
(t1_bracket_final, t1_stage_id, t1_team_ids[1], t1_team_ids[2], 2, 1, true);
771+
(t1_bracket_sf1, t1_stage_id, t1_team_ids[1], t1_team_ids[4], 1, 1, 1, 'WB', true),
772+
(t1_bracket_sf2, t1_stage_id, t1_team_ids[2], t1_team_ids[3], 1, 2, 1, 'WB', true),
773+
(t1_bracket_final, t1_stage_id, t1_team_ids[1], t1_team_ids[2], 2, 1, 1, 'WB', true);
774774

775775
-- Create matches linked to finished brackets
776776
-- SF1: T1 vs T4 → T1 wins, SF2: T2 vs T3 → T2 wins, Final: T1 vs T2 → T1 wins
@@ -980,23 +980,23 @@ BEGIN
980980
END LOOP;
981981

982982
-- First round brackets (3 matches for 6 teams)
983-
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, finished)
983+
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, "group", path, finished)
984984
VALUES
985-
(t2_bracket_r1m1, t2_stage_id, t2_team_ids[1], t2_team_ids[6], 1, 1, true);
986-
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, finished)
985+
(t2_bracket_r1m1, t2_stage_id, t2_team_ids[1], t2_team_ids[6], 1, 1, 1, 'WB', true);
986+
INSERT INTO tournament_brackets (id, tournament_stage_id, tournament_team_id_1, tournament_team_id_2, round, match_number, "group", path, finished)
987987
VALUES
988-
(t2_bracket_r1m2, t2_stage_id, t2_team_ids[2], t2_team_ids[5], 1, 2, false),
989-
(t2_bracket_r1m3, t2_stage_id, t2_team_ids[3], t2_team_ids[4], 1, 3, false);
988+
(t2_bracket_r1m2, t2_stage_id, t2_team_ids[2], t2_team_ids[5], 1, 2, 1, 'WB', false),
989+
(t2_bracket_r1m3, t2_stage_id, t2_team_ids[3], t2_team_ids[4], 1, 3, 1, 'WB', false);
990990

991991
-- Semifinal brackets (placeholders)
992-
INSERT INTO tournament_brackets (tournament_stage_id, tournament_team_id_1, round, match_number, finished)
992+
INSERT INTO tournament_brackets (tournament_stage_id, tournament_team_id_1, round, match_number, "group", path, finished)
993993
VALUES
994-
(t2_stage_id, t2_team_ids[1], 2, 1, false),
995-
(t2_stage_id, NULL, 2, 2, false);
994+
(t2_stage_id, t2_team_ids[1], 2, 1, 1, 'WB', false),
995+
(t2_stage_id, NULL, 2, 2, 1, 'WB', false);
996996

997997
-- Final bracket
998-
INSERT INTO tournament_brackets (tournament_stage_id, round, match_number, finished)
999-
VALUES (t2_stage_id, 3, 1, false);
998+
INSERT INTO tournament_brackets (tournament_stage_id, round, match_number, "group", path, finished)
999+
VALUES (t2_stage_id, 3, 1, 1, 'WB', false);
10001000

10011001
-- Create match for the one finished bracket (R1 M1: T1 vs T6, T1 wins)
10021002
DECLARE

0 commit comments

Comments
 (0)