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

33 lines
770 B
MySQL
Raw Normal View History

2023-08-02 14:54:18 -04:00
DROP TABLE IF EXISTS project;
2023-08-02 12:00:27 -04:00
CREATE TABLE project (
title VARCHAR(64) NOT NULL,
body TEXT DEFAULT NULL,
difficulty INT NOT NULL DEFAULT 1 REFERENCES difficulty(diff),
2023-08-02 12:04:48 -04:00
repo_link VARCHAR(128) DEFAULT NULL,
2023-08-02 12:00:27 -04:00
trigger_date DATE DEFAULT NULL,
started DATE NOT NULL DEFAULT CURRENT_DATE,
span INT NOT NULL DEFAULT 7 -- time to last for in days
);
2023-08-02 14:54:18 -04:00
DROP TABLE IF EXISTS difficulty;
2023-08-02 12:00:27 -04:00
CREATE TABLE difficulty (
diff VARCHAR(16)
);
2023-08-02 14:54:18 -04:00
DROP TABLE IF EXISTS tag;
2023-08-02 12:00:27 -04:00
CREATE TABLE tag (
t VARCHAR(16)
);
2023-08-02 14:54:18 -04:00
DROP TABLE IF EXISTS project_tag;
2023-08-02 12:00:27 -04:00
CREATE TABLE project_tag (
project INT REFERENCES project(rowid),
tag INT REFERENCES tag(rowid)
);
2023-08-02 14:54:18 -04:00
DROP TABLE IF EXISTS assignment;
CREATE TABLE assignment (
who VARCHAR(32) NOT NULL,
project INT NOT NULL REFERENCES project(rowid)
);