From ca973edc28b5fe543c583217896590f4a2e98897 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Thu, 24 Aug 2023 22:34:05 +0300
Subject: fix: mod flag for easy check (#49)

Former-commit-id: 06ee23ee9659834252d3cb5c3c255797e9f93b62
---
 backend/database/init.sql | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

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

diff --git a/backend/database/init.sql b/backend/database/init.sql
index 11d4944..25de872 100644
--- a/backend/database/init.sql
+++ b/backend/database/init.sql
@@ -3,6 +3,10 @@ CREATE TABLE users (
   user_name TEXT NOT NULL,
   avatar_link TEXT NOT NULL,
   country_code CHAR(2) NOT NULL,
+  p2sr TEXT NOT NULL DEFAULT '-',
+  steam TEXT NOT NULL DEFAULT '-',
+  youtube TEXT NOT NULL DEFAULT '-',
+  twitch TEXT NOT NULL DEFAULT '-',
   created_at TIMESTAMP NOT NULL DEFAULT now(),
   updated_at TIMESTAMP NOT NULL DEFAULT now(),
   PRIMARY KEY (steam_id)
@@ -117,9 +121,16 @@ CREATE TABLE records_mp (
 );
 
 CREATE TABLE titles (
-  user_id TEXT,
+  id SERIAL,
   title_name TEXT NOT NULL,
-  PRIMARY KEY (user_id),
+  title_color CHAR(6) NOT NULL,
+  PRIMARY KEY (id)
+);
+
+CREATE TABLE user_titles (
+  title_id INT NOT NULL,
+  user_id TEXT NOT NULL,
+  FOREIGN KEY (title_id) REFERENCES titles(id),
   FOREIGN KEY (user_id) REFERENCES users(steam_id)
 );
 
-- 
cgit v1.2.3

