diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/schema.sql | 6 | ||||
-rw-r--r-- | db/schema_0027-rename_open311conf.sql | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/db/schema.sql b/db/schema.sql index 6ebec5689..87b5102c7 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -447,12 +447,12 @@ create table admin_log ( whenedited timestamp not null default ms_current_timestamp() ); --- Record open 311 configuration details +-- Record details of reporting bodies, including open311 configuration details -create table open311conf ( +create table body ( id serial primary key, area_id integer not null unique, - endpoint text not null, + endpoint text, jurisdiction text, api_key text, send_method text, diff --git a/db/schema_0027-rename_open311conf.sql b/db/schema_0027-rename_open311conf.sql new file mode 100644 index 000000000..cef020648 --- /dev/null +++ b/db/schema_0027-rename_open311conf.sql @@ -0,0 +1,12 @@ +begin; + +ALTER TABLE open311conf RENAME TO body; +ALTER INDEX open311conf_pkey RENAME TO body_pkey; +ALTER INDEX open311conf_area_id_key RENAME TO body_area_id_key; +ALTER TABLE body ALTER COLUMN endpoint DROP NOT NULL; +ALTER TABLE body DROP CONSTRAINT open311conf_comment_user_id_fkey; +ALTER TABLE body ADD CONSTRAINT body_comment_user_id_fkey + FOREIGN KEY (comment_user_id) REFERENCES users(id); +ALTER SEQUENCE open311conf_id_seq RENAME TO body_id_seq; + +commit; |