namespace reorg
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithDatabaseToSchemaVersions.pm
CommitLineData
e70a1600 1package DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions;
2use Moose::Role;
3
c703d15d 4use DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions;
e70a1600 5
6use Carp 'carp';
7
8has version_handler => (
24f4524b 9 is => 'ro',
e70a1600 10 lazy_build => 1,
24f4524b 11 does => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
12 handles => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
e70a1600 13);
14
15sub _build_version_handler {
16 my $self = shift;
38bd9956 17
18 my $args = {
e70a1600 19 schema => $self->schema,
38bd9956 20 };
21
22 $args->{to_version} = $self->to_version if $self->has_to_version;
c703d15d 23 DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions->new($args);
e70a1600 24}
25
261;
27
28__END__
29
30vim: ts=2 sw=2 expandtab