diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/schema.sql | 20 | ||||
-rw-r--r-- | db/schema_0048-response-templates-add-state.sql | 6 | ||||
-rw-r--r-- | db/schema_0049-response-priorities-add-external_id.sql | 6 | ||||
-rw-r--r-- | db/schema_0050-add-defect-type-table.sql | 21 |
4 files changed, 53 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql index d3bb5040e..18c1533d9 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -135,6 +135,7 @@ CREATE TABLE response_priorities ( deleted boolean not null default 'f', name text not null, description text, + external_id text, unique(body_id, name) ); @@ -486,6 +487,7 @@ create table response_templates ( text text not null, created timestamp not null default current_timestamp, auto_response boolean NOT NULL DEFAULT 'f', + state text, unique(body_id, title) ); @@ -500,3 +502,21 @@ CREATE TABLE contact_response_priorities ( contact_id int REFERENCES contacts(id) NOT NULL, response_priority_id int REFERENCES response_priorities(id) NOT NULL ); + +CREATE TABLE defect_types ( + id serial not null primary key, + body_id int references body(id) not null, + name text not null, + description text not null, + extra text, + unique(body_id, name) +); + +CREATE TABLE contact_defect_types ( + id serial NOT NULL PRIMARY KEY, + contact_id int REFERENCES contacts(id) NOT NULL, + defect_type_id int REFERENCES defect_types(id) NOT NULL +); + +ALTER TABLE problem + ADD COLUMN defect_type_id int REFERENCES defect_types(id); diff --git a/db/schema_0048-response-templates-add-state.sql b/db/schema_0048-response-templates-add-state.sql new file mode 100644 index 000000000..1bc95ee6d --- /dev/null +++ b/db/schema_0048-response-templates-add-state.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE response_templates + ADD COLUMN state TEXT; + +COMMIT; diff --git a/db/schema_0049-response-priorities-add-external_id.sql b/db/schema_0049-response-priorities-add-external_id.sql new file mode 100644 index 000000000..1d8a1ba1e --- /dev/null +++ b/db/schema_0049-response-priorities-add-external_id.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE response_priorities + ADD COLUMN external_id TEXT; + +COMMIT; diff --git a/db/schema_0050-add-defect-type-table.sql b/db/schema_0050-add-defect-type-table.sql new file mode 100644 index 000000000..d65e17940 --- /dev/null +++ b/db/schema_0050-add-defect-type-table.sql @@ -0,0 +1,21 @@ +BEGIN; + +CREATE TABLE defect_types ( + id serial not null primary key, + body_id int references body(id) not null, + name text not null, + description text not null, + extra text, + unique(body_id, name) +); + +CREATE TABLE contact_defect_types ( + id serial NOT NULL PRIMARY KEY, + contact_id int REFERENCES contacts(id) NOT NULL, + defect_type_id int REFERENCES defect_types(id) NOT NULL +); + +ALTER TABLE problem + ADD COLUMN defect_type_id int REFERENCES defect_types(id); + +COMMIT; |