pull/882/head
chanhengseang 2025-05-25 18:41:55 -07:00
parent 98b2cf54de
commit 65029306c3
2 changed files with 15 additions and 59 deletions

View File

@ -19,67 +19,23 @@ CREATE TABLE match_group
);
-- Create match table
CREATE TABLE ` match `
CREATE TABLE `match`
(
id
BIGINT
PRIMARY
KEY
AUTO_INCREMENT,
match_group_id
BIGINT,
team_a_id
BIGINT,
team_b_id
BIGINT,
score_a
INT
DEFAULT
0,
score_b
INT
DEFAULT
0,
team_a_win
BIT
DEFAULT
0,
team_b_win
BIT
DEFAULT
0,
score_verified
BIT
DEFAULT
0,
CONSTRAINT
fk_match_group
FOREIGN
KEY
(
match_group_id
) REFERENCES match_group
(
id
),
CONSTRAINT fk_team_a FOREIGN KEY
(
team_a_id
) REFERENCES team
(
id
),
CONSTRAINT fk_team_b FOREIGN KEY
(
team_b_id
) REFERENCES team
(
id
)
);
id BIGINT PRIMARY KEY AUTO_INCREMENT,
match_group_id BIGINT,
team_a_id BIGINT,
team_b_id BIGINT,
score_a INT DEFAULT 0,
score_b INT DEFAULT 0,
team_a_win BIT DEFAULT 0,
team_b_win BIT DEFAULT 0,
score_verified BIT DEFAULT 0,
CONSTRAINT fk_match_group FOREIGN KEY (match_group_id) REFERENCES match_group (id),
CONSTRAINT fk_team_a FOREIGN KEY (team_a_id) REFERENCES team (id),
CONSTRAINT fk_team_b FOREIGN KEY (team_b_id) REFERENCES team (id)
);
-- Add match_group_id column to team table
ALTER TABLE team
ADD COLUMN match_group_id BIGINT,
ADD CONSTRAINT fk_team_match_group FOREIGN KEY (match_group_id) REFERENCES match_group (id);

View File

@ -129,7 +129,7 @@ public class Event implements Serializable {
private boolean allowWaitList;
@ManyToMany
@JoinTable(name = "event_player",
@JoinTable(name = "event_co_host_player",
joinColumns = {@JoinColumn(name = "event_id",referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "player_id",referencedColumnName = "id")})
private List<Player> coHostPlayers = new ArrayList<>();