aboutsummaryrefslogtreecommitdiff
path: root/backend/database
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2024-07-05 21:03:46 +0300
committerGitHub <noreply@github.com>2024-07-05 21:03:46 +0300
commitd35a9a945ecaeeceb21bd91eeeaa4c6ec0a15e24 (patch)
treec7eca0aa1e5a84b3580a629bcce49215b6faf80e /backend/database
parentfeat: update map tables db schema (#157) (diff)
downloadlphub-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.sql12
-rw-r--r--backend/database/init.sql9
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
8INSERT 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
39CREATE 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
39CREATE TABLE maps ( 48CREATE TABLE maps (
40 id SERIAL, 49 id SERIAL,
41 game_id SMALLINT NOT NULL, 50 game_id SMALLINT NOT NULL,