diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-10 12:55:06 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-10 13:05:27 +0100 |
commit | c7cd951c502f91ffae6b3d7f36540cb34aa4a49b (patch) | |
tree | 901c3b12b9c2e5aad21131cd71fceaa7ca1e9c8c | |
parent | fb3162de6d65e04f33051f35cb0e611f9156f41a (diff) |
Fix issues with database migration script.
A reference to ->storage was missed as this script changed in a
different branch. The schema files contain transaction commands
themselves. A check for migration 52 was missing.
-rwxr-xr-x | bin/update-schema | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/update-schema b/bin/update-schema index 573cfc19c..82632faa6 100755 --- a/bin/update-schema +++ b/bin/update-schema @@ -45,7 +45,7 @@ use mySociety::MaPit; use Getopt::Long; use Pod::Usage; -my $db = FixMyStreet::DB->storage; +my $db = FixMyStreet::DB->schema->storage; my ($commit, $version, $downgrade, $help); @@ -99,12 +99,10 @@ sub get_statements { } sub run_statements { - $db->txn_begin; foreach my $st (@_) { print "."; $db->dbh->do($st); } - $db->txn_commit; print "\n"; } @@ -197,6 +195,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 '0052' if table_exists('translation'); return '0051' if column_exists('contacts', 'state'); return '0050' if table_exists('defect_types'); return '0049' if column_exists('response_priorities', 'external_id'); |