aboutsummaryrefslogtreecommitdiff
path: root/backend/database/init.sql
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-12 09:56:11 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-12 09:56:11 +0300
commitcae45e130891cf97f93d743ace381eb8209df2a8 (patch)
tree72498d3b34da119eac40804282f896655e41b3b4 /backend/database/init.sql
parentfeat: is_coop field on map summary (diff)
downloadlphub-cae45e130891cf97f93d743ace381eb8209df2a8.tar.gz
lphub-cae45e130891cf97f93d743ace381eb8209df2a8.tar.bz2
lphub-cae45e130891cf97f93d743ace381eb8209df2a8.zip
fix: unique relation for map history and routes
Former-commit-id: f3ea2ce6784973385d63980b6680294bbcee0188
Diffstat (limited to 'backend/database/init.sql')
-rw-r--r--backend/database/init.sql6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/database/init.sql b/backend/database/init.sql
index c7d098c..196cb71 100644
--- a/backend/database/init.sql
+++ b/backend/database/init.sql
@@ -49,7 +49,8 @@ CREATE TABLE map_routes (
49 showcase TEXT NOT NULL, 49 showcase TEXT NOT NULL,
50 PRIMARY KEY (id), 50 PRIMARY KEY (id),
51 FOREIGN KEY (map_id) REFERENCES maps(id), 51 FOREIGN KEY (map_id) REFERENCES maps(id),
52 FOREIGN KEY (category_id) REFERENCES categories(id) 52 FOREIGN KEY (category_id) REFERENCES categories(id),
53 UNIQUE (map_id, category_id, score_count)
53); 54);
54 55
55CREATE TABLE map_history ( 56CREATE TABLE map_history (
@@ -61,7 +62,8 @@ CREATE TABLE map_history (
61 record_date TIMESTAMP NOT NULL, 62 record_date TIMESTAMP NOT NULL,
62 PRIMARY KEY (id), 63 PRIMARY KEY (id),
63 FOREIGN KEY (category_id) REFERENCES categories(id), 64 FOREIGN KEY (category_id) REFERENCES categories(id),
64 FOREIGN KEY (map_id) REFERENCES maps(id) 65 FOREIGN KEY (map_id) REFERENCES maps(id),
66 UNIQUE (map_id, category_id, score_count)
65); 67);
66 68
67CREATE TABLE map_ratings ( 69CREATE TABLE map_ratings (