diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-07-05 21:03:46 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-05 21:03:46 +0300 |
| commit | d35a9a945ecaeeceb21bd91eeeaa4c6ec0a15e24 (patch) | |
| tree | c7eca0aa1e5a84b3580a629bcce49215b6faf80e /backend/database | |
| parent | feat: update map tables db schema (#157) (diff) | |
| download | lphub-d35a9a945ecaeeceb21bd91eeeaa4c6ec0a15e24.tar.gz lphub-d35a9a945ecaeeceb21bd91eeeaa4c6ec0a15e24.tar.bz2 lphub-d35a9a945ecaeeceb21bd91eeeaa4c6ec0a15e24.zip | |
feat: return portal count from games and chapter map select (#155)
Diffstat (limited to 'backend/database')
| -rw-r--r-- | backend/database/categories.sql | 12 | ||||
| -rw-r--r-- | backend/database/init.sql | 9 |
2 files changed, 20 insertions, 1 deletions
diff --git a/backend/database/categories.sql b/backend/database/categories.sql index 5cadad5..6bbf9b0 100644 --- a/backend/database/categories.sql +++ b/backend/database/categories.sql | |||
| @@ -2,4 +2,14 @@ INSERT INTO categories(id, name) VALUES | |||
| 2 | (1, 'CM'), | 2 | (1, 'CM'), |
| 3 | (2, 'No SLA'), | 3 | (2, 'No SLA'), |
| 4 | (3, 'Inbounds SLA'), | 4 | (3, 'Inbounds SLA'), |
| 5 | (4, 'Any%'); \ No newline at end of file | 5 | (4, 'Any%'), |
| 6 | (5, 'All Courses'); | ||
| 7 | |||
| 8 | INSERT INTO game_categories(id, game_id, category_id) VALUES | ||
| 9 | (1, 1, 1), | ||
| 10 | (2, 1, 2), | ||
| 11 | (3, 1, 3), | ||
| 12 | (4, 1, 4), | ||
| 13 | (5, 2, 1), | ||
| 14 | (6, 2, 4), | ||
| 15 | (7, 2, 5); \ No newline at end of file | ||
diff --git a/backend/database/init.sql b/backend/database/init.sql index c33821b..77a88f5 100644 --- a/backend/database/init.sql +++ b/backend/database/init.sql | |||
| @@ -36,6 +36,15 @@ CREATE TABLE categories ( | |||
| 36 | PRIMARY KEY (id) | 36 | PRIMARY KEY (id) |
| 37 | ); | 37 | ); |
| 38 | 38 | ||
| 39 | CREATE TABLE game_categories ( | ||
| 40 | id SERIAL, | ||
| 41 | game_id SMALLINT NOT NULL, | ||
| 42 | category_id SMALLINT NOT NULL, | ||
| 43 | PRIMARY KEY (id), | ||
| 44 | FOREIGN KEY (game_id) REFERENCES games(id), | ||
| 45 | FOREIGN KEY (category_id) REFERENCES categories(id) | ||
| 46 | ); | ||
| 47 | |||
| 39 | CREATE TABLE maps ( | 48 | CREATE TABLE maps ( |
| 40 | id SERIAL, | 49 | id SERIAL, |
| 41 | game_id SMALLINT NOT NULL, | 50 | game_id SMALLINT NOT NULL, |