Skip to content

Commit

Permalink
fix schema upgrade script for initial deploy
Browse files Browse the repository at this point in the history
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
  • Loading branch information
preaction committed Apr 30, 2019
1 parent 5b18220 commit 5fd8766
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/cpantesters-schema
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ sub install {
sub upgrade {
my $schema = CPAN::Testers::Schema->connect_from_config;
if ( !$schema->get_db_version() ) {
$schema->install( '0.000' );
$schema->deploy;
}
else {
$schema->upgrade;
}
$schema->upgrade;
}

sub fetch {
Expand Down

0 comments on commit 5fd8766

Please sign in to comment.