aboutsummaryrefslogtreecommitdiff
path: root/etc/setup.sql
blob: 35ddea4aa7b3a08b724527f664978417157a70f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
);