aboutsummaryrefslogtreecommitdiffstats
path: root/bin/update-schema
diff options
context:
space:
mode:
Diffstat (limited to 'bin/update-schema')
-rwxr-xr-x[-rw-r--r--]bin/update-schema7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/update-schema b/bin/update-schema
index 81c9ff4ab..92868e1b6 100644..100755
--- a/bin/update-schema
+++ b/bin/update-schema
@@ -19,13 +19,14 @@ use mySociety::DBHandle qw(dbh);
use mySociety::MaPit;
mySociety::Config::set_file("$FindBin::Bin/../conf/general");
-mySociety::DBHandle::configure(
+my %args = (
Name => mySociety::Config::get('FMS_DB_NAME'),
User => mySociety::Config::get('FMS_DB_USER'),
Password => mySociety::Config::get('FMS_DB_PASS'),
- Host => mySociety::Config::get('FMS_DB_HOST', undef),
- Port => mySociety::Config::get('FMS_DB_PORT', undef)
);
+$args{Host} = mySociety::Config::get('FMS_DB_HOST', undef) if mySociety::Config::get('FMS_DB_HOST');
+$args{Port} = mySociety::Config::get('FMS_DB_PORT', undef) if mySociety::Config::get('FMS_DB_PORT');
+mySociety::DBHandle::configure( %args );
my $commit = 0;
$commit = 1 if @ARGV && $ARGV[0] eq '--commit';