From ec31ea0e37d8d975894d52a53b13618da504c95b Mon Sep 17 00:00:00 2001 From: anon Date: Wed, 2 Aug 2023 18:00:27 +0200 Subject: [PATCH] db prototype --- init.sql | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 init.sql diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..39fddc6 --- /dev/null +++ b/init.sql @@ -0,0 +1,35 @@ +CREATE TABLE project ( + title VARCHAR(64) NOT NULL, + body TEXT DEFAULT NULL, + difficulty INT NOT NULL DEFAULT 1 REFERENCES difficulty(diff), + trigger_date DATE DEFAULT NULL, + started DATE NOT NULL DEFAULT CURRENT_DATE, + span INT NOT NULL DEFAULT 7 -- time to last for in days +); + +CREATE TABLE difficulty ( + diff VARCHAR(16) +); + +INSERT INTO difficulty VALUES('easy'); +INSERT INTO difficulty VALUES('medium'); +INSERT INTO difficulty VALUES('hard'); +INSERT INTO difficulty VALUES('fuck you'); + + +CREATE TABLE tag ( + t VARCHAR(16) +); + +-- Some default (not all) tags +INSERT INTO tag VALUES('math'); +INSERT INTO tag VALUES('AI'); +INSERT INTO tag VALUES('networking'); +INSERT INTO tag VALUES('games'); +INSERT INTO tag VALUES('rendering'); +INSERT INTO tag VALUES('simulation'); + +CREATE TABLE project_tag ( + project INT REFERENCES project(rowid), + tag INT REFERENCES tag(rowid) +);