Skip to content

Commit

Permalink
Add season_number column (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps authored Dec 6, 2021
1 parent 487a631 commit f783a82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions migrations/V010__add_season_number_column.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER table league_season
ADD COLUMN `season_number` INTEGER NOT NULL AFTER placement_games;

UPDATE league_season SET season_number = 1, name_key = "2v2_season" WHERE id = 1;
UPDATE league_season SET season_number = 1, name_key = "1v1_season" WHERE id = 2;
UPDATE league_season SET season_number = 2, name_key = "2v2_season" WHERE id = 3;
UPDATE league_season SET season_number = 2, name_key = "1v1_season" WHERE id = 4;
10 changes: 5 additions & 5 deletions tests/data/test-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ INSERT INTO league (id, technical_name, image_url, medium_image_url, small_image
(2, "second_test_league", "https://faf.com/", "https://faf.com/medium/", "https://faf.com/small/", "L2", "description_key"),
(3, "league_without_seasons", "https://faf.com/", "https://faf.com/medium/", "https://faf.com/small/", "L3", "description_key");

INSERT INTO league_season (id, league_id, leaderboard_id, name_key, start_date, end_date) VALUES
(1, 1, 1, "season.1", NOW() - interval 2 year, NOW() - interval 1 year),
(2, 1, 1, "season.2", NOW() - interval 1 year, NOW() + interval 1 year),
(3, 2, 2, "season.3", NOW() - interval 2 year, NOW() + interval 1 year),
(4, 1, 1, "season.4", NOW() + interval 1 year, NOW() + interval 2 year);
INSERT INTO league_season (id, league_id, leaderboard_id, placement_games, season_number, name_key, start_date, end_date) VALUES
(1, 1, 1, 10, 1, "season.1", NOW() - interval 2 year, NOW() - interval 1 year),
(2, 1, 1, 10, 2, "season.2", NOW() - interval 1 year, NOW() + interval 1 year),
(3, 2, 2, 10, 1, "season.3", NOW() - interval 2 year, NOW() + interval 1 year),
(4, 1, 1, 10, 3, "season.4", NOW() + interval 1 year, NOW() + interval 2 year);

INSERT INTO league_season_division (id, league_season_id, division_index, name_key, description_key) VALUES
(1, 1, 1, "L1D1", "description_key"),
Expand Down

0 comments on commit f783a82

Please sign in to comment.