From 4cee97e695c889445c3146bc8169a89b132855ea Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 29 Apr 2021 18:04:56 +0300 Subject: Finish user management --- etc/setup.sql | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 etc/setup.sql (limited to 'etc') 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 +); + -- cgit v1.2.1