Skip to content

Commit 165b673

Browse files
committed
chore: do not delete brackets or mathces when canceled or regenerate on start
1 parent 7b254e2 commit 165b673

3 files changed

Lines changed: 0 additions & 29 deletions

File tree

hasura/functions/tournaments/delete_tournament_brackets.sql

Lines changed: 0 additions & 22 deletions
This file was deleted.

hasura/functions/tournaments/update_tournament_stages.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ BEGIN
2828
RAISE NOTICE 'Tournament ID: %', _tournament_id;
2929
RAISE NOTICE 'Tournament Status: %', tournament_status;
3030

31-
PERFORM delete_tournament_brackets_and_matches(_tournament_id);
32-
3331
-- Process each stage
3432
FOR stage IN SELECT * FROM tournament_stages ts WHERE ts.tournament_id = _tournament_id ORDER BY ts."order" LOOP
3533
RAISE NOTICE '--- PROCESSING STAGE % ---', stage."order";

hasura/triggers/tournaments.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ DECLARE
77
BEGIN
88

99
IF (NEW.status IS DISTINCT FROM OLD.status AND NEW.status = 'Live') THEN
10-
PERFORM update_tournament_stages(NEW.id);
1110
PERFORM assign_seeds_to_teams(NEW);
1211

1312
SELECT id INTO first_stage_id
@@ -20,10 +19,6 @@ BEGIN
2019
END IF;
2120
END IF;
2221

23-
IF (NEW.status = 'Cancelled' OR NEW.status = 'CancelledMinTeams') THEN
24-
PERFORM delete_tournament_brackets_and_matches(NEW.id);
25-
END IF;
26-
2722
RETURN NEW;
2823
END;
2924
$$;

0 commit comments

Comments
 (0)