-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed unnecessary relation property from player teams #125
- Loading branch information
Showing
14 changed files
with
173 additions
and
65 deletions.
There are no files selected for viewing
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
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
15 changes: 15 additions & 0 deletions
15
...ats-api/src/main/resources/io/github/oasis/db/schema/changelogs/v0001-06-removegameid.yml
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,15 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: remove_col_gameid_player_teams | ||
author: isuruw | ||
changes: | ||
- dropPrimaryKey: | ||
tableName: OA_PLAYER_TEAM | ||
dropIndex: true | ||
- dropColumn: | ||
tableName: OA_PLAYER_TEAM | ||
columnName: game_id | ||
- addPrimaryKey: | ||
tableName: OA_PLAYER_TEAM | ||
columnNames: team_id, player_id | ||
constraintName: pk_oa_player_team |
127 changes: 127 additions & 0 deletions
127
services/stats-api/src/main/resources/io/github/oasis/db/scripts/er.txt
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,127 @@ | ||
//// -- LEVEL 1 | ||
//// -- Schemas, Tables and References | ||
|
||
Table OA_PLAYER { | ||
id int [pk, increment] | ||
version int [default: 1] | ||
display_name varchar(64) | ||
email varchar(64) | ||
avatar_ref varchar(255) | ||
timezone varchar(64) | ||
gender smallint | ||
is_active boolean | ||
created_at bigint | ||
updated_at bigint | ||
} | ||
|
||
Table OA_TEAM { | ||
id int [pk, increment] | ||
version int | ||
name varchar(64) | ||
color_code varchar(10) | ||
avatar_ref varchar(255) | ||
game_id int | ||
is_active boolean | ||
created_at bigint | ||
updated_at bigint | ||
} | ||
|
||
Table OA_PLAYER_TEAM { | ||
game_id int | ||
player_id int | ||
team_id int | ||
created_at bigint | ||
|
||
Indexes { | ||
(game_id, player_id) [pk] | ||
} | ||
} | ||
|
||
Table OA_ELEMENT { | ||
id int [pk, increment] | ||
version int | ||
name varchar(128) | ||
type varchar(64) | ||
description varchar(512) | ||
game_id int | ||
def_id varchar(128) | ||
is_active boolean | ||
created_at bigint | ||
updated_at bigint | ||
} | ||
|
||
Table OA_ELEMENT_DATA { | ||
element_id int [pk, unique] | ||
def_data blob | ||
is_active boolean | ||
} | ||
|
||
Table OA_RANK_DEF { | ||
id int [pk] | ||
name varchar(64) | ||
priority int | ||
color_code varchar(10) | ||
game_id int [not null] | ||
} | ||
|
||
Table OA_GAME { | ||
id int [pk, increment] | ||
version int | ||
name varchar(32) | ||
motto varchar(128) | ||
description varchar(512) | ||
logo_ref varchar(255) | ||
is_active boolean | ||
created_at bigint | ||
updated_at bigint | ||
} | ||
|
||
Table OA_GAME_STATUS { | ||
game_id int [not null] | ||
status varchar(32) | ||
updated_at bigint | ||
} | ||
|
||
Table OA_EVENT_SOURCE { | ||
id int [pk, increment] | ||
token varchar(255) | ||
display_name varchar(255) | ||
download_count smallint | ||
is_active boolean | ||
created_at bigint | ||
updated_at bigint | ||
} | ||
|
||
Table OA_EVENT_SOURCE_KEY { | ||
event_source_id int [not null] | ||
public_key text | ||
private_key text | ||
download_count smallint | ||
} | ||
|
||
Table OA_EVENT_SOURCE_GAME { | ||
game_id int [ref: > OA_GAME.id] | ||
event_source_id int | ||
|
||
Indexes { | ||
(game_id, event_source_id) [pk] | ||
} | ||
} | ||
|
||
Table OA_API_KEY { | ||
token varchar(128) | ||
secret_key varchar(255) | ||
roles int | ||
is_active boolean | ||
} | ||
|
||
Ref: OA_RANK_DEF.game_id > OA_GAME.id | ||
Ref: OA_TEAM.game_id > OA_GAME.id | ||
REF: OA_PLAYER_TEAM.game_id > OA_GAME.id | ||
Ref: OA_PLAYER_TEAM.player_id > OA_PLAYER.id | ||
Ref: OA_PLAYER_TEAM.team_id > OA_TEAM.id | ||
Ref: OA_ELEMENT.game_id > OA_GAME.id | ||
Ref: OA_ELEMENT_DATA.element_id - OA_ELEMENT.id | ||
Ref: OA_EVENT_SOURCE_KEY.event_source_id - OA_EVENT_SOURCE.id | ||
Ref: OA_GAME_STATUS.game_id > OA_GAME.id | ||
Ref: OA_EVENT_SOURCE_GAME.event_source_id > OA_EVENT_SOURCE.id |
4 changes: 2 additions & 2 deletions
4
...es/stats-api/src/main/resources/io/github/oasis/db/scripts/players/insertPlayerToTeam.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
INSERT INTO OA_PLAYER_TEAM | ||
(game_id, team_id, player_id, created_at) | ||
(team_id, player_id, created_at) | ||
VALUES | ||
(:gameId, :teamId, :playerId, :ts) | ||
(:teamId, :playerId, :ts) |
2 changes: 1 addition & 1 deletion
2
services/stats-api/src/main/resources/io/github/oasis/db/scripts/players/readPlayerTeams.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
SELECT | ||
SELECT | ||
ot.id, | ||
ot.game_id AS gameId, | ||
ot.name, | ||
|
2 changes: 0 additions & 2 deletions
2
.../stats-api/src/main/resources/io/github/oasis/db/scripts/players/removePlayerFromTeam.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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
DELETE FROM | ||
OA_PLAYER_TEAM | ||
WHERE | ||
game_id = :gameId | ||
AND | ||
player_id = :playerId | ||
AND | ||
team_id = :teamId |
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