aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/setup.sql28
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/setup.sql b/etc/setup.sql
new file mode 100644
index 0000000..35ddea4
--- /dev/null
+++ b/etc/setup.sql
@@ -0,0 +1,28 @@
+-- users table
+CREATE TABLE users (
+id SERIAL PRIMARY KEY,
+username varchar(50) NOT NULL,
+password varchar(255) NOT NULL,
+email varchar(50) NOT NULL,
+can_edit_bugs boolean DEFAULT true,
+can_edit_reports boolean DEFAULT true
+);
+
+-- bugs table
+CREATE TABLE bugs (
+id SERIAL PRIMARY KEY,
+title varchar(50) NOT NULL,
+description text NOT NULL,
+author integer NOT NULL REFERENCES users(id),
+assignee integer REFERENCES users(id)
+);
+
+-- reports table
+CREATE TABLE reports (
+id SERIAL PRIMARY KEY,
+bug integer REFERENCES bugs(id),
+author integer NOT NULL REFERENCES users(id),
+title varchar(50) NOT NULL,
+description text NOT NULL
+);
+