diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-02-17 17:43:54 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-02-26 11:40:15 +0000 |
commit | 18adbe946c1104338e6abff159b4f9877154969c (patch) | |
tree | 5bae6c894981d3d90724f75c241c9d1e4c848dc2 /db | |
parent | 97133a07a181e6cccc207cc6598a08e8028ad7ca (diff) |
Add a new "staff" contact state.
This state will appear when reporting if you are logged in as a staff
member of the relevant body, but otherwise not appear on the site.
Diffstat (limited to 'db')
-rw-r--r-- | db/downgrade_0072---0071.sql | 21 | ||||
-rw-r--r-- | db/schema.sql | 2 | ||||
-rw-r--r-- | db/schema_0072-add-staff-contact-state.sql | 23 |
3 files changed, 46 insertions, 0 deletions
diff --git a/db/downgrade_0072---0071.sql b/db/downgrade_0072---0071.sql new file mode 100644 index 000000000..aa649f63d --- /dev/null +++ b/db/downgrade_0072---0071.sql @@ -0,0 +1,21 @@ +BEGIN; + +ALTER TABLE contacts DROP CONSTRAINT contacts_state_check; + +ALTER TABLE contacts ADD CONSTRAINT contacts_state_check CHECK ( + state = 'unconfirmed' + or state = 'confirmed' + or state = 'inactive' + or state = 'deleted' +); + +ALTER TABLE contacts_history DROP CONSTRAINT contacts_history_state_check; + +ALTER TABLE contacts_history ADD CONSTRAINT contacts_history_state_check CHECK ( + state = 'unconfirmed' + or state = 'confirmed' + or state = 'inactive' + or state = 'deleted' +); + +COMMIT; diff --git a/db/schema.sql b/db/schema.sql index 0e38ad862..ed21aded6 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -100,6 +100,7 @@ create table contacts ( state = 'unconfirmed' or state = 'confirmed' or state = 'inactive' + or state = 'staff' or state = 'deleted' ), @@ -137,6 +138,7 @@ create table contacts_history ( state = 'unconfirmed' or state = 'confirmed' or state = 'inactive' + or state = 'staff' or state = 'deleted' ), diff --git a/db/schema_0072-add-staff-contact-state.sql b/db/schema_0072-add-staff-contact-state.sql new file mode 100644 index 000000000..efaac2d20 --- /dev/null +++ b/db/schema_0072-add-staff-contact-state.sql @@ -0,0 +1,23 @@ +BEGIN; + +ALTER TABLE contacts DROP CONSTRAINT contacts_state_check; + +ALTER TABLE contacts ADD CONSTRAINT contacts_state_check CHECK ( + state = 'unconfirmed' + or state = 'confirmed' + or state = 'inactive' + or state = 'staff' + or state = 'deleted' +); + +ALTER TABLE contacts_history DROP CONSTRAINT contacts_history_state_check; + +ALTER TABLE contacts_history ADD CONSTRAINT contacts_history_state_check CHECK ( + state = 'unconfirmed' + or state = 'confirmed' + or state = 'inactive' + or state = 'staff' + or state = 'deleted' +); + +COMMIT; |