diff options
Diffstat (limited to 'db/schema.sql')
-rw-r--r-- | db/schema.sql | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/db/schema.sql b/db/schema.sql index c96059fb1..27f4bad13 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -127,6 +127,15 @@ create trigger contacts_update_trigger after update on contacts create trigger contacts_insert_trigger after insert on contacts for each row execute procedure contacts_updated(); +-- Problems can have priorities. This table must be created before problem. +CREATE TABLE response_priorities ( + id serial not null primary key, + body_id int references body(id) not null, + deleted boolean not null default 'f', + name text not null, + unique(body_id, name) +); + -- Problems reported by users of site create table problem ( id serial not null primary key, @@ -185,7 +194,8 @@ create table problem ( extra text, -- extra fields required for open311 flagged boolean not null default 'f', geocode bytea, - + response_priority_id int REFERENCES response_priorities(id), + -- logging sending failures (used by webservices) send_fail_count integer not null default 0, send_fail_reason text, @@ -482,3 +492,9 @@ CREATE TABLE contact_response_templates ( contact_id int REFERENCES contacts(id) NOT NULL, response_template_id int REFERENCES response_templates(id) NOT NULL ); + +CREATE TABLE contact_response_priorities ( + id serial NOT NULL PRIMARY KEY, + contact_id int REFERENCES contacts(id) NOT NULL, + response_priority_id int REFERENCES response_priorities(id) NOT NULL +); |