aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql15
-rw-r--r--db/schema_0009-add_extra_to_problem.sql6
-rw-r--r--db/schema_0010-add_open311_conf.sql11
-rw-r--r--db/schema_0011-add_extra_to_contacts.sql6
4 files changed, 37 insertions, 1 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 99cf2832d..fcd137919 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -78,7 +78,10 @@ create table contacts (
-- time of last change
whenedited timestamp not null,
-- what the last change was for: author's notes
- note text not null
+ note text not null,
+
+ -- extra fields required for open311
+ extra text
);
create unique index contacts_area_id_category_idx on contacts(area_id, category);
@@ -184,6 +187,7 @@ create table problem (
lastupdate timestamp not null default ms_current_timestamp(),
whensent timestamp,
send_questionnaire boolean not null default 't',
+ extra text, -- extra fields required for open311
flagged boolean not null default 'f'
);
create index problem_state_latitude_longitude_idx on problem(state, latitude, longitude);
@@ -407,3 +411,12 @@ create table admin_log (
whenedited timestamp not null default ms_current_timestamp()
);
+-- Record open 311 configuration details
+
+create table open311conf (
+ id serial primary key,
+ area_id integer not null unique,
+ endpoint text not null,
+ jurisdiction text,
+ api_key text
+);
diff --git a/db/schema_0009-add_extra_to_problem.sql b/db/schema_0009-add_extra_to_problem.sql
new file mode 100644
index 000000000..bac5806c7
--- /dev/null
+++ b/db/schema_0009-add_extra_to_problem.sql
@@ -0,0 +1,6 @@
+begin;
+
+ALTER TABLE problem
+ ADD COLUMN extra TEXT;
+
+commit;
diff --git a/db/schema_0010-add_open311_conf.sql b/db/schema_0010-add_open311_conf.sql
new file mode 100644
index 000000000..920272c05
--- /dev/null
+++ b/db/schema_0010-add_open311_conf.sql
@@ -0,0 +1,11 @@
+begin;
+
+CREATE TABLE open311conf (
+ id SERIAL PRIMARY KEY,
+ area_id INTEGER NOT NULL unique,
+ endpoint TEXT NOT NULL,
+ jurisdiction TEXT,
+ api_key TEXT
+);
+
+commit;
diff --git a/db/schema_0011-add_extra_to_contacts.sql b/db/schema_0011-add_extra_to_contacts.sql
new file mode 100644
index 000000000..fd6eae807
--- /dev/null
+++ b/db/schema_0011-add_extra_to_contacts.sql
@@ -0,0 +1,6 @@
+begin;
+
+ALTER TABLE contacts
+ ADD COLUMN extra TEXT;
+
+commit;