test cases for recent changes and test DBs other than mysql
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / MigrationSchema / SchemaLoader.pm
CommitLineData
41a539b4 1package DBIx::Class::DeploymentHandler::MigrationSchema::SchemaLoader;
7d876442 2
3use Moose;
4use DBIx::Class::Schema::Loader;
5
41a539b4 6with 'DBIx::Class::DeploymentHandler::HandlesMigrationSchema';
7d876442 7
8has schema => (is=>'ro', required=>1);
9
10my %opts = (
11 naming => { ALL => 'v7'},
12 use_namespaces => 1,
13 debug => $ENV{DBIC_DEPLOYMENTHANDLER_DEBUG}||0);
14
15my $cnt = 0;
16
17sub migration_schema {
18 my $schema = shift->schema->clone;
19 my $name = ref($schema) . $cnt++;
20 DBIx::Class::Schema::Loader::make_schema_at
21 $name, \%opts, [ sub {$schema->storage->dbh} ];
22}
23
241;
25
26# vim: ts=2 sw=2 expandtab
27
28__END__
29
41a539b4 30=method migration_schema
7d876442 31
41a539b4 32 my $schema = $dh->migration_schema;
7d876442 33
34Provides a L<DBIx::Class::Schema> object that we can pass to the Perl deploy
35scripts. We reverse engineer a C<$schema> from whatever is currently deployed
36to the database using L<DBIx::Class::Schema::Loader>