-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
126 additions
and
27 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
migrations/2018-02-18-062321_fix_user_ratings_tablee/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alter table user_ratings drop column deviation; | ||
alter table user_ratings drop column volatility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
alter table user_ratings alter column rating type numeric(6, 2); | ||
alter table user_ratings alter column rating set default 1500.0; | ||
alter table user_ratings add column deviation numeric(5, 2) not null default 350.0; | ||
alter table user_ratings add column volatility numeric(3, 2) not null default 0.3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
drop table game_titles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
create table game_titles ( | ||
game_title_id serial primary key, | ||
game_name varchar not null, | ||
unique(game_name) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
drop table game_modes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
create table game_modes ( | ||
game_mode_id serial primary key, | ||
game_title_id integer references game_titles not null, | ||
mode_name varchar not null, | ||
unique(game_title_id, mode_name) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table user_ratings drop column game_mode_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table user_ratings add column game_mode_id integer references game_modes not null; |
1 change: 1 addition & 0 deletions
1
migrations/2018-02-18-070703_add_team_size_to_game_modes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table game_modes drop column team_size; |
1 change: 1 addition & 0 deletions
1
migrations/2018-02-18-070703_add_team_size_to_game_modes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table game_modes add column team_size integer not null; |
1 change: 1 addition & 0 deletions
1
migrations/2018-02-18-071905_add_default_games_and_modes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
truncate game_titles restart identity cascade; |
20 changes: 20 additions & 0 deletions
20
migrations/2018-02-18-071905_add_default_games_and_modes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
insert into game_titles (game_name) values | ||
('Overwatch'), | ||
('LawBreakers') | ||
; | ||
|
||
with ow_id as ( | ||
select game_title_id as id | ||
from game_titles | ||
where game_name = 'Overwatch' | ||
) | ||
insert into game_modes (game_title_id, mode_name, team_size) values | ||
((select id from ow_id), 'Standard', 6), | ||
((select id from ow_id), 'Capture The Flag', 6), | ||
((select id from ow_id), '1v1', 1), | ||
((select id from ow_id), '5v5', 5); | ||
|
||
with lb_id as (select game_title_id as id from game_titles where game_name = 'LawBreakers') | ||
insert into game_modes (game_title_id, mode_name, team_size) values | ||
((select id from lb_id), 'Standard', 5), | ||
((select id from lb_id), 'Team Deathmatch', 6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters