aboutsummaryrefslogtreecommitdiffstats
path: root/db/schema_0045-response-priorities.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema_0045-response-priorities.sql')
-rw-r--r--db/schema_0045-response-priorities.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/schema_0045-response-priorities.sql b/db/schema_0045-response-priorities.sql
new file mode 100644
index 000000000..16215e40c
--- /dev/null
+++ b/db/schema_0045-response-priorities.sql
@@ -0,0 +1,20 @@
+BEGIN;
+
+CREATE TABLE response_priorities (
+ id serial not null primary key,
+ body_id int references body(id) not null,
+ name text not null,
+ deleted boolean not null default 'f',
+ unique(body_id, name)
+);
+
+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
+);
+
+ALTER TABLE problem
+ ADD COLUMN response_priority_id int REFERENCES response_priorities(id);
+
+COMMIT;