summaryrefslogtreecommitdiff
path: root/SCHEMA.sql
diff options
context:
space:
mode:
authorJani Peter Karhunen <jkarhun2@local>2023-11-25 03:32:29 +0200
committerJani Peter Karhunen <jkarhun2@local>2023-11-25 03:32:29 +0200
commitd2de3ae10b6f5314bd4b8243218212d2004f35b0 (patch)
tree2ab448e0c2ec361478851dbcb43bcd176d17b584 /SCHEMA.sql
parentc059696450d301b99956d643c21b0e46b4fc39dc (diff)
MEGA Commit. Rework of routing. Visuals. Answer analysis and much more.
Diffstat (limited to 'SCHEMA.sql')
-rw-r--r--SCHEMA.sql47
1 files changed, 46 insertions, 1 deletions
diff --git a/SCHEMA.sql b/SCHEMA.sql
index 6832923..b88215a 100644
--- a/SCHEMA.sql
+++ b/SCHEMA.sql
@@ -1,3 +1,4 @@
+DROP TABLE users, questions, answers, questionaires, quiz_links;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
nick TEXT,
@@ -21,6 +22,50 @@ CREATE TABLE questionaires (
id SERIAL PRIMARY KEY,
questionset INT[] DEFAULT '{}',
creator_id INT,
- ready BOOLEAN DEFAULT FALSE,
created INT
);
+CREATE TABLE quiz_links (
+ id SERIAL PRIMARY KEY,
+ quiz_id INT,
+ link TEXT,
+ created INT
+);
+INSERT INTO users (nick, created) VALUES ('Raili Niemi', 57 );
+INSERT INTO users (nick, created) VALUES ('Tea Jalava', 36 );
+INSERT INTO users (nick, created) VALUES ('Eero Metsäranta', 47 );
+INSERT INTO questions (question, neg_answer, pos_answer, created)
+ VALUES ('Mikä ikä?', '0', '100', 99 );
+INSERT INTO questions (question, neg_answer, pos_answer, created)
+ VALUES ('Mikä vointi?', 'huono', 'hyvä', 99 );
+INSERT INTO questions (question, neg_answer, pos_answer, created)
+ VALUES ('Ulkoiletko?', 'viime vuonna', 'joka päivä', 99 );
+INSERT INTO questions (question, neg_answer, pos_answer, created)
+ VALUES ('kys?', 'ei vielä', 'ei koskaan', 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (1, 1, 570, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (1, 2, 670, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (1, 3, 888, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (1, 4, 999, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (2, 1, 360, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (2, 2, 230, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (2, 3, 120, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (2, 4, 123, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (3, 1, 470, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (3, 2, 570, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (3, 3, 321, 99 );
+INSERT INTO answers (user_id, question_id, answer, created)
+ VALUES (3, 4, 785, 99 );
+INSERT INTO questionaires (questionset, creator_id, created)
+ VALUES ('{1,2,3,4}', 1, 666);
+INSERT INTO quiz_links (quiz_id, link, created)
+ VALUES (1, 'kyselama', 666);