aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-13 12:27:38 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-15 00:11:06 +0000
commitb715f69fc0a92e25761f124a3a05b7116a73c598 (patch)
tree1c5c9c2324953a24cd8982f5eadbf74411dbfdcb /db
parent0bcae44e9b9837f25f9b8f96988c71929f4bd43b (diff)
Convert report sending code to use bodies rather than areas/councils.
Diffstat (limited to 'db')
-rw-r--r--db/schema.sql1
-rw-r--r--db/schema_0030-add-body-name.sql7
2 files changed, 8 insertions, 0 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 549222b1a..9fd4ce332 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -419,6 +419,7 @@ create table admin_log (
create table body (
id serial primary key,
+ name text not null,
area_id integer not null unique,
endpoint text,
jurisdiction text,
diff --git a/db/schema_0030-add-body-name.sql b/db/schema_0030-add-body-name.sql
new file mode 100644
index 000000000..30ac26e98
--- /dev/null
+++ b/db/schema_0030-add-body-name.sql
@@ -0,0 +1,7 @@
+begin;
+
+ALTER TABLE body ADD name text;
+UPDATE body SET name='';
+ALTER table body ALTER COLUMN name SET NOT NULL;
+
+commit;