From 40537dace937fc96c851c56f0cb629f36dddfd03 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Tue, 20 Jun 2023 19:55:31 +0300
Subject: feat: improved map summary response, all routes init (#43, #46)

---
 backend/database/init.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'backend/database/init.sql')

diff --git a/backend/database/init.sql b/backend/database/init.sql
index 871aba2..76c3aa6 100644
--- a/backend/database/init.sql
+++ b/backend/database/init.sql
@@ -54,20 +54,24 @@ CREATE TABLE map_routes (
 CREATE TABLE map_history (
   id SMALLSERIAL,
   map_id SMALLINT NOT NULL,
+  category_id SMALLINT NOT NULL,
   user_name TEXT NOT NULL,
   score_count SMALLINT NOT NULL,
   record_date TIMESTAMP NOT NULL,
   PRIMARY KEY (id),
+  FOREIGN KEY (category_id) REFERENCES categories(id),
   FOREIGN KEY (map_id) REFERENCES maps(id)
 );
 
 CREATE TABLE map_ratings (
   id SERIAL,
   map_id SMALLINT NOT NULL,
+  category_id SMALLINT NOT NULL,
   user_id TEXT NOT NULL,
   rating SMALLINT NOT NULL,
   PRIMARY KEY (id),
   FOREIGN KEY (map_id) REFERENCES maps(id),
+  FOREIGN KEY (category_id) REFERENCES categories(id),
   FOREIGN KEY (user_id) REFERENCES users(steam_id)
 );
 
-- 
cgit v1.2.3

