Skip to content

Commit 5fd8766

Browse files
committed
fix schema upgrade script for initial deploy
If we don't have a database yet, we need to just deploy it. `install()` just says "this is the version we already have", which we only need to use for the existing cpanstats database until we migrate entirely into DBIx::Class
1 parent 5b18220 commit 5fd8766

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/cpantesters-schema

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ sub install {
106106
sub upgrade {
107107
my $schema = CPAN::Testers::Schema->connect_from_config;
108108
if ( !$schema->get_db_version() ) {
109-
$schema->install( '0.000' );
109+
$schema->deploy;
110+
}
111+
else {
112+
$schema->upgrade;
110113
}
111-
$schema->upgrade;
112114
}
113115

114116
sub fetch {

0 commit comments

Comments
 (0)