This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
probotic/bootstrap/init.sql
2023-08-04 09:13:47 -06:00

33 lines
770 B
SQL

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)
);