-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add single column primary key to league_season_score (#20)
* Closes #19 add single column primary key to league_season_score * Add constraint for login and league_season to be unique in league_season_score Co-authored-by: Clemens Borys <[email protected]>
- Loading branch information
1 parent
0ea5d1b
commit 5154c09
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
migrations/V003__add_single_primary_key_to_score_table.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,14 @@ | ||
DROP TABLE league_season_score; | ||
|
||
CREATE TABLE league_season_score | ||
( | ||
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
login_id MEDIUMINT(8) UNSIGNED NOT NULL, | ||
league_season_id MEDIUMINT(8) UNSIGNED NOT NULL, | ||
subdivision_id INT(10) UNSIGNED, | ||
score INT, | ||
game_count INT NOT NULL DEFAULT 0, | ||
FOREIGN KEY (subdivision_id) REFERENCES league_season_division_subdivision (id), | ||
UNIQUE INDEX (login_id, league_season_id), | ||
UNIQUE INDEX (login_id, score, league_season_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