aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-04-29 18:04:56 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2021-04-29 18:04:56 +0300
commit4cee97e695c889445c3146bc8169a89b132855ea (patch)
tree693489f2f89f86e277255dfe0f9d5482ecad0359 /etc
parentAdd nginx and php-fpm config files (diff)
downloadbugtracker-4cee97e695c889445c3146bc8169a89b132855ea.tar.xz
Finish user management
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
+);
+