CREATE TABLE users_t ( user_id int PRIMARY KEY, username text NOT NULL ); CREATE TABLE status_t ( status_id int PRIMARY KEY, name text NOT NULL ); CREATE TABLE patches_t ( patch_id int PRIMARY KEY, summary text, status int REFERENCES status_t, category text, date text, submitted_by int REFERENCES users_t, assigned_to int REFERENCES users_t, summary_url text ); CREATE TABLE category_t ( category_id int PRIMARY KEY, name text NOT NULL ); CREATE TABLE resolution_t ( resolution_id int PRIMARY KEY, name text NOT NULL ); CREATE TABLE bug_group_t ( bug_group_id int PRIMARY KEY, name text NOT NULL ); CREATE TABLE bug_t ( bug_id int PRIMARY KEY, summary text, bug_group_id int REFERENCES bug_group_t, category_id int REFERENCES category_t, resolution_id int REFERENCES resolution_t, status_id int REFERENCES status_t, assigned_to int REFERENCES users_t, priority int );