aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-10-03 17:47:25 +0100
committerDave Whiteland <dave@mysociety.org>2012-10-03 17:47:25 +0100
commit272dba7ce6d59d81b52579dd4c5fc7d65e9bec20 (patch)
treecabbefec7823061781050ffb002a38ce53d68f56 /db
parent39c1b648b30e67ceb8912a35b386eb4ee23857b8 (diff)
parentf16a3e96b65394089d10c46c1d67cf82c67e72dd (diff)
Merge branch 'fmb-read-only'
Conflicts: db/schema.sql perllib/FixMyStreet/DB/Result/Contact.pm perllib/FixMyStreet/DB/Result/Problem.pm
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql16
-rw-r--r--db/schema_0021-add_external_source_columns_to_problem.sql8
-rw-r--r--db/schema_0022-add_interest_count_to_problems.sql6
-rw-r--r--db/schema_0023-add_can_be_devolved_and_category_config.sql13
4 files changed, 42 insertions, 1 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 6e9396f45..1f0d0d4c3 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -85,6 +85,12 @@ create table contacts (
-- for things like missed bin collections
non_public boolean default 'f'
+
+ -- per contact endpoint configuration
+ endpoint text,
+ jurisdiction text default '',
+ api_key text default '',
+ send_method text
);
create unique index contacts_area_id_category_idx on contacts(area_id, category);
@@ -205,6 +211,13 @@ create table problem (
-- for things like missed bin collections
non_public BOOLEAN default 'f'
+
+ -- record details about messages from external sources, eg. message manager
+ external_source text,
+ external_source_id text,
+
+ -- number of me toos
+ interest_count integer
);
create index problem_state_latitude_longitude_idx on problem(state, latitude, longitude);
create index problem_user_id_idx on problem ( user_id );
@@ -444,5 +457,6 @@ create table open311conf (
send_method text,
send_comments boolean not null default 'f',
comment_user_id int references users(id),
- suppress_alerts boolean not null default 'f'
+ suppress_alerts boolean not null default 'f',
+ can_be_devolved boolean not null default 'f'
);
diff --git a/db/schema_0021-add_external_source_columns_to_problem.sql b/db/schema_0021-add_external_source_columns_to_problem.sql
new file mode 100644
index 000000000..a74bcce7d
--- /dev/null
+++ b/db/schema_0021-add_external_source_columns_to_problem.sql
@@ -0,0 +1,8 @@
+begin;
+
+ALTER table problem
+ ADD column external_source TEXT;
+ALTER table problem
+ ADD column external_source_id TEXT;
+
+commit;
diff --git a/db/schema_0022-add_interest_count_to_problems.sql b/db/schema_0022-add_interest_count_to_problems.sql
new file mode 100644
index 000000000..62092aa0a
--- /dev/null
+++ b/db/schema_0022-add_interest_count_to_problems.sql
@@ -0,0 +1,6 @@
+begin;
+
+ALTER table problem
+ ADD COLUMN interest_count integer;
+
+commit;
diff --git a/db/schema_0023-add_can_be_devolved_and_category_config.sql b/db/schema_0023-add_can_be_devolved_and_category_config.sql
new file mode 100644
index 000000000..6eba0919a
--- /dev/null
+++ b/db/schema_0023-add_can_be_devolved_and_category_config.sql
@@ -0,0 +1,13 @@
+begin;
+
+ALTER table open311conf
+ ADD column can_be_devolved BOOL NOT NULL DEFAULT 'f';
+
+ALTER table contacts
+ ADD column endpoint TEXT,
+ ADD column jurisdiction TEXT DEFAULT '',
+ ADD column api_key TEXT DEFAULT '',
+ ADD column send_method TEXT
+;
+
+commit;