DBICDHTest::ready;
-my $db = 'dbi:SQLite:db.db';
-my @connection = ($db, '', '', { ignore_version => 1 });
+my $dbh = DBICDHTest::dbh();
+my @connection = (sub { $dbh }, { ignore_version => 1 });
my $sql_dir = 't/sql';
VERSION1: {
$DBICVersion::Schema::VERSION = 1;
ok($s, 'DBICVersion::Schema 1 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
sql_translator_args => { add_drop_table => 0 },
ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
my $version = $s->schema_version;
- $handler->prepare_deploy;
+ $handler->prepare_install;
dies_ok {
$s->resultset('Foo')->create({
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
my $version = $s->schema_version();
- $handler->prepare_deploy();
- $handler->prepare_upgrade(1, $version);
+ $handler->prepare_install;
+ $handler->prepare_upgrade({ from_version => 1, to_version => $version });
dies_ok {
$s->resultset('Foo')->create({
bar => 'frew',
$DBICVersion::Schema::VERSION = 3;
ok($s, 'DBICVersion::Schema 3 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
ok($handler, 'DBIx::Class::DeploymentHandler w/3 instantiates correctly');
my $version = $s->schema_version();
- $handler->prepare_deploy;
- $handler->prepare_upgrade( 2, $version );
+ $handler->prepare_install;
+ $handler->prepare_upgrade({ from_version => 2, to_version => $version });
dies_ok {
$s->resultset('Foo')->create({
bar => 'frew',
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
my $version = $s->schema_version();
- $handler->prepare_downgrade(3, $version);
+ $handler->prepare_downgrade({ from_version => 3, to_version => $version });
lives_ok {
$s->resultset('Foo')->create({
bar => 'frew',