From 935243d8b4ea992c50315f0c8fcb300365a5762d Mon Sep 17 00:00:00 2001
From: Emil
Date: Fri, 4 Aug 2023 09:13:47 -0600
Subject: Initial commit

---
 bootstrap/init.sql | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 bootstrap/init.sql

(limited to 'bootstrap/init.sql')

diff --git a/bootstrap/init.sql b/bootstrap/init.sql
new file mode 100644
index 0000000..c3ae440
--- /dev/null
+++ b/bootstrap/init.sql
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS project;
+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
+);
+
+DROP TABLE IF EXISTS difficulty;
+CREATE TABLE difficulty (
+	diff VARCHAR(16)
+);
+
+DROP TABLE IF EXISTS tag;
+CREATE TABLE tag (
+	t VARCHAR(16)
+);
+
+DROP TABLE IF EXISTS project_tag;
+CREATE TABLE project_tag (
+	project INT REFERENCES project(rowid),
+	tag INT REFERENCES tag(rowid)
+);
+
+DROP TABLE IF EXISTS assignment;
+CREATE TABLE assignment (
+	who VARCHAR(32) NOT NULL,
+	repo_link VARCHAR(128) DEFAULT NULL,
+	project INT NOT NULL REFERENCES project(rowid)
+);
-- 
cgit v1.2.3

