Skip to content

Commit 1c4035e

Browse files
committed
schema upgrade now installs if necessary
This means that an auto-deployment script can just use "upgrade" to do everything it needs to do.
1 parent 34cfa37 commit 1c4035e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/cpantesters-schema

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ my %tasks = (
7070
check => \&check,
7171
);
7272

73-
$tasks{ shift @ARGV }->();
73+
$tasks{ shift @ARGV }->( @ARGV );
7474

7575
sub prepare {
7676
my $schema = CPAN::Testers::Schema->connect_from_config;
@@ -102,6 +102,9 @@ sub install {
102102

103103
sub upgrade {
104104
my $schema = CPAN::Testers::Schema->connect_from_config;
105+
if ( !$schema->get_db_version() ) {
106+
$schema->install( '0.000' );
107+
}
105108
$schema->upgrade;
106109
}
107110

0 commit comments

Comments
 (0)