added brackets to foreign keys

This commit is contained in:
aboolathings 2022-05-22 22:00:16 +01:00
parent eca360285d
commit cb55fef42e
1 changed files with 16 additions and 16 deletions

View File

@ -124,34 +124,34 @@ REFERENCES tournaments(tournament_id)
ADD CONSTRAINT fk_tournament_participants(player_id) ADD CONSTRAINT fk_tournament_participants(player_id)
FOREIGN KEY (player_id) FOREIGN KEY (player_id)
REFERENCES players(player_id) REFERENCES players(player_id)
ADD CONSTRAINT fk_tp_teams ADD CONSTRAINT fk_tournament_participants(team_id)
FOREIGN KEY team_id FOREIGN KEY (team_id)
REFERENCES teams(team_id); REFERENCES teams(team_id);
ALTER TABLE prizes ALTER TABLE prizes
ADD CONSTRAINT fk_p_sponsors ADD CONSTRAINT fk_prizes(sponsor_id)
FOREIGN KEY sponsor_id FOREIGN KEY (sponsor_id)
REFERENCES sponsors(sponsor_id) REFERENCES sponsors(sponsor_id)
ADD CONSTRAINT fk_p_tournaments ADD CONSTRAINT fk_prizes(tournament_id)
FOREIGN KEY tournament_id FOREIGN KEY (tournament_id)
REFERENCES tournaments(tournament_id); REFERENCES tournaments(tournament_id);
ALTER TABLE games ALTER TABLE games
ADD CONSTRAINT fk_g_rounds ADD CONSTRAINT fk_games(round_id)
FOREIGN KEY round_id FOREIGN KEY (round_id)
REFERENCES rounds(round_id); REFERENCES rounds(round_id);
ALTER TABLE statistics ALTER TABLE statistics
ADD CONSTRAINT fk_s_games ADD CONSTRAINT fk_statistics(game_id)
FOREIGN KEY game_id FOREIGN KEY (game_id)
REFERENCES games(game_id); REFERENCES games(game_id);
ALTER TABLE game_participants ALTER TABLE game_participants
ADD CONSTRAINT fk_gp_games ADD CONSTRAINT fk_game_participants(game_id)
FOREIGN KEY game_id FOREIGN KEY (game_id)
REFERENCES games(game_id) REFERENCES games(game_id)
ADD CONSTRAINT fk_gp_tournament_participants ADD CONSTRAINT fk_game_participants(tournament_participant_id)
FOREIGN KEY tournament_participant_id FOREIGN KEY (tournament_participant_id)
REFERENCES tournament_participants(tournament_participant_id); REFERENCES tournament_participants(tournament_participant_id);
-- CHECK -- CHECK
@ -178,7 +178,7 @@ ALTER TABLE tournaments
ADD CONSTRAINT ck_tournament_city ADD CONSTRAINT ck_tournament_city
CHECK (tournament_city = UPPER(tournament_city)) CHECK (tournament_city = UPPER(tournament_city))
ADD CONSTRAINT ck_tournament_country ADD CONSTRAINT ck_tournament_country
CHECK (tournament_country = UPPER(tournament_country_)) CHECK (tournament_country = UPPER(tournament_country))
ADD CONSTRAINT ck_tournament_arena ADD CONSTRAINT ck_tournament_arena
CHECK (tournament_arena = UPPER(tournament_arena)); CHECK (tournament_arena = UPPER(tournament_arena));