diff options
author | Russ Allbery <rra@stanford.edu> | 2013-02-13 18:24:56 -0800 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2013-02-13 18:28:25 -0800 |
commit | b750e56ea3f93fbc09917cacfc6b2737ef9671a7 (patch) | |
tree | f19cb293db809850bad909002602143ea68b1e71 | |
parent | a03d2f7fedc1088bce90e2b921ae2aeae06fddd0 (diff) |
Set upgrade directory in Wallet::Admin
In the upgrade() wrapper in Wallet::Admin, set the DDL directory
in the schema before attempting an upgrade.
Change-Id: I691184fc4cf416e68f300bc78f7caffc41bf94b8
Reviewed-on: https://gerrit.stanford.edu/793
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
-rw-r--r-- | perl/Wallet/Admin.pm | 1 | ||||
-rwxr-xr-x | perl/t/admin.t | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/perl/Wallet/Admin.pm b/perl/Wallet/Admin.pm index 9fc146c..fd184a0 100644 --- a/perl/Wallet/Admin.pm +++ b/perl/Wallet/Admin.pm @@ -195,6 +195,7 @@ sub upgrade { # Perform the actual upgrade. if ($self->{schema}->get_db_version) { + $self->{schema}->upgrade_directory ($Wallet::Config::DB_DDL_DIRECTORY); eval { $self->{schema}->upgrade; }; } if ($@) { diff --git a/perl/t/admin.t b/perl/t/admin.t index ff69ee9..a11b9b2 100755 --- a/perl/t/admin.t +++ b/perl/t/admin.t @@ -63,8 +63,6 @@ $Wallet::Schema::VERSION = '0.07'; is ($admin->reinitialize ('admin@EXAMPLE.COM'), 1, ' and re-initialization succeeds'); $Wallet::Schema::VERSION = '0.08'; -my $schema = $admin->schema; -$schema->upgrade_directory ('sql/'); my $retval = $admin->upgrade; is ($retval, 1, 'Performing an upgrade succeeds'); my $dbh = $admin->dbh; |