working tests with actual version handling
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithDatabaseToSchemaVersions.pm
1 package DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions;
2 use Moose::Role;
3
4 use DBIx::Class::DeploymentHandler::DatabaseToSchemaVersions;
5
6 use Carp 'carp';
7
8 has version_handler => (
9
10 # < mst> isa => 'DBIx::Class::DeploymentHandler::SqltDeployMethod',
11 # < mst> should be
12 # < mst> does => <some role>
13 # < mst> and that role should supply those methods
14 # < mst> then you can pass handles => <some role> as well
15
16   does => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
17   is  => 'ro',
18   lazy_build => 1,
19   handles => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
20 );
21
22 sub _build_version_handler {
23   my $self = shift;
24
25   my $args = {
26     schema => $self->schema,
27   };
28
29   $args->{to_version} = $self->to_version if $self->has_to_version;
30   DBIx::Class::DeploymentHandler::DatabaseToSchemaVersions->new($args);
31 }
32
33 1;
34
35 __END__
36
37 vim: ts=2 sw=2 expandtab