8 use DBIx::Class::DeploymentHandler;
9 use aliased 'DBIx::Class::DeploymentHandler', 'DH';
11 use File::Path 'remove_tree';
17 my $dbh = DBI->connect('dbi:SQLite::memory:');
18 my @connection = (sub { $dbh }, { ignore_version => 1 });
19 my $sql_dir = 't/sql';
21 use_ok 'DBICVersion_v1';
22 my $s = DBICVersion::Schema->connect(@connection);
23 $DBICVersion::Schema::VERSION = 1;
24 ok($s, 'DBICVersion::Schema 1 instantiates correctly');
27 script_directory => $sql_dir,
29 databases => 'SQLite',
30 sql_translator_args => { add_drop_table => 0 },
33 ok($dh, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
34 $dh->prepare_version_storage_install;
37 dies_ok { $s->resultset('__VERSION')->first->version } 'version_storage not installed';
38 $dh->install_version_storage;
40 $dh->add_database_version( { version => $s->schema_version } );
42 lives_ok { $s->resultset('__VERSION')->first->version } 'version_storage installed';