aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-03-29 11:45:37 +0100
committerDave Arter <davea@mysociety.org>2018-03-29 16:04:33 +0100
commit90cf72fd66099bde47557c4eadf10856b8afffb2 (patch)
tree0e4016d8691ea6dd382d3ac9962b048ddee623b3
parent9e806177d239f20ce3b11bf220800b0623ebc075 (diff)
add convert_latlong option to body table
For controlling if reports pulled in via Open311 should have the position converted from Easting/Northing to lat/long.
-rwxr-xr-xbin/update-schema1
-rw-r--r--db/downgrade_0060---0059.sql5
-rw-r--r--db/schema.sql1
-rw-r--r--db/schema_0060-add-convert_latlong.sql5
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm6
5 files changed, 16 insertions, 2 deletions
diff --git a/bin/update-schema b/bin/update-schema
index cfc963e75..bbfd732f2 100755
--- a/bin/update-schema
+++ b/bin/update-schema
@@ -212,6 +212,7 @@ else {
# (assuming schema change files are never half-applied, which should be the case)
sub get_db_version {
return 'EMPTY' if ! table_exists('problem');
+ return '0060' if column_exists('body', 'convert_latlong');
return '0059' if column_exists('response_templates', 'external_status_code');
return '0058' if column_exists('body', 'blank_updates_permitted');
return '0057' if column_exists('body', 'fetch_problems');
diff --git a/db/downgrade_0060---0059.sql b/db/downgrade_0060---0059.sql
new file mode 100644
index 000000000..67ba29eb1
--- /dev/null
+++ b/db/downgrade_0060---0059.sql
@@ -0,0 +1,5 @@
+BEGIN;
+
+ALTER TABLE body DROP convert_latlong;
+
+COMMIT;
diff --git a/db/schema.sql b/db/schema.sql
index 7d4b90d3d..d08ea675d 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -56,6 +56,7 @@ create table body (
send_extended_statuses boolean not null default 'f',
fetch_problems boolean not null default 'f',
blank_updates_permitted boolean not null default 'f',
+ convert_latlong boolean not null default 'f',
deleted boolean not null default 'f'
);
diff --git a/db/schema_0060-add-convert_latlong.sql b/db/schema_0060-add-convert_latlong.sql
new file mode 100644
index 000000000..50c617e2c
--- /dev/null
+++ b/db/schema_0060-add-convert_latlong.sql
@@ -0,0 +1,5 @@
+BEGIN;
+
+ALTER TABLE body ADD convert_latlong boolean default 'f' not null;
+
+COMMIT;
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index a9df1aeb7..0b11f2771 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -47,6 +47,8 @@ __PACKAGE__->add_columns(
"fetch_problems",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
"blank_updates_permitted",
+ { data_type => "boolean", default_value => \"false", is_nullable => 1 },
+ "convert_latlong",
{ data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
@@ -122,8 +124,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-03-01 12:27:28
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dzqgZI1wkGDPS2PfJgDEIg
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2018-03-15 12:38:36
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rturOWpYmPRO0yE9yWHXjA
use Moo;
use namespace::clean;