-- users table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username varchar(50) NOT NULL UNIQUE,
password varchar(255) NOT NULL,
email varchar(50) NOT NULL UNIQUE,
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)
);

-- 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
);

