From 24f3c154665f777e985d29263ed99a7b968949cc Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Thu, 12 Jan 2023 11:49:23 +0300
Subject: demo to google drive is worknig properly (#20)

---
 backend/database/init.sql | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

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

diff --git a/backend/database/init.sql b/backend/database/init.sql
index 4f68e0d..f69bf10 100644
--- a/backend/database/init.sql
+++ b/backend/database/init.sql
@@ -25,12 +25,14 @@ CREATE TABLE maps (
 
 CREATE TABLE records (
   id SERIAL,
-  map_id SMALLINT,
+  map_id SMALLINT NOT NULL,
   host_id TEXT NOT NULL,
   score_count SMALLINT NOT NULL,
   score_time INTEGER NOT NULL,
   is_coop BOOLEAN NOT NULL DEFAULT false,
   partner_id TEXT NOT NULL DEFAULT '',
+  demo_id TEXT NOT NULL,
+  record_date TIMESTAMP NOT NULL DEFAULT now(),
   PRIMARY KEY (id),
   FOREIGN KEY (map_id) REFERENCES maps(id),
   FOREIGN KEY (host_id) REFERENCES users(steam_id),
@@ -42,11 +44,4 @@ CREATE TABLE titles (
   title_name TEXT NOT NULL,
   PRIMARY KEY (user_id),
   FOREIGN KEY (user_id) REFERENCES users(steam_id)
-);
-
-CREATE TABLE showcases (
-  record_id INT,
-  video_id TEXT NOT NULL,
-  PRIMARY KEY (record_id),
-  FOREIGN KEY (record_id) REFERENCES records(id)
 );
\ No newline at end of file
-- 
cgit v1.2.3

