close $prerun;
$dm->preinstall({ version => '1.0' });
- ok -e 'foobar';
+ ok -e 'foobar', 'perl migration runs';
{
my $warned = 0;
close $common;
ok(
- -f catfile(qw( t sql SQLite schema 1.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite schema 1.0 001-auto.sql-json )),
'1.0 schema gets generated properly'
);
$version = $s->schema_version();
$dm->prepare_deploy;
ok(
- -f catfile(qw( t sql SQLite schema 2.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite schema 2.0 001-auto.sql-json )),
'2.0 schema gets generated properly'
);
mkpath(catfile(qw( t sql SQLite up 1.0-2.0 )));
ok( $warned, 'prepare_upgrade with a bogus preversion warns' );
}
ok(
- -f catfile(qw( t sql SQLite up 1.0-2.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite up 1.0-2.0 001-auto.sql-json )),
'1.0-2.0 diff gets generated properly and default start and end versions get set'
);
mkpath(catfile(qw( t sql SQLite down 2.0-1.0 )));
version_set => [$version, '1.0']
});
ok(
- -f catfile(qw( t sql SQLite down 2.0-1.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite down 2.0-1.0 001-auto.sql-json )),
'2.0-1.0 diff gets generated properly'
);
dies_ok {
$version = $s->schema_version();
$dm->prepare_deploy;
ok(
- -f catfile(qw( t sql SQLite schema 3.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite schema 3.0 001-auto.sql-json )),
'2.0 schema gets generated properly'
);
$dm->prepare_downgrade({
version_set => [$version, '1.0']
});
ok(
- -f catfile(qw( t sql SQLite down 3.0-1.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite down 3.0-1.0 001-auto.sql-json )),
'3.0-1.0 diff gets generated properly'
);
$dm->prepare_upgrade({
version_set => ['1.0', $version]
});
ok(
- -f catfile(qw( t sql SQLite up 1.0-3.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite up 1.0-3.0 001-auto.sql-json )),
'1.0-3.0 diff gets generated properly'
);
$dm->prepare_upgrade({
ok( $warned, 'prepare_upgrade warns if you clobber an existing upgrade file' );
}
ok(
- -f catfile(qw( t sql SQLite up 1.0-2.0 001-auto.sql )),
+ -f catfile(qw( t sql SQLite up 1.0-2.0 001-auto.sql-json )),
'2.0-3.0 diff gets generated properly'
);
mkpath catfile(qw( t sql _generic up 2.0-3.0 ));
- rename catfile(qw( t sql SQLite up 2.0-3.0 001-auto.sql )), catfile(qw( t sql _generic up 2.0-3.0 001-auto.sql ));
+ rename catfile(qw( t sql SQLite up 2.0-3.0 001-auto.sql-json )), catfile(qw( t sql _generic up 2.0-3.0 001-auto.sql-json ));
rmtree(catfile(qw( t sql SQLite )));
warn 'how can this be' if -d catfile(qw( t sql SQLite ));
dies_ok {