faster travis builds
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithMonotonicVersions.pm
1 package DBIx::Class::DeploymentHandler::WithMonotonicVersions;
2 use Moose::Role;
3
4 use DBIx::Class::DeploymentHandler::VersionHandler::Monotonic;
5
6 has version_handler => (
7   is         => 'ro',
8   lazy_build => 1,
9   does       => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
10   handles    => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
11 );
12
13 sub _build_version_handler {
14   my $self = shift;
15
16   my $args = {
17     database_version => $self->database_version,
18     schema_version   => $self->schema_version,
19   };
20
21   $args->{to_version} = $self->to_version if $self->has_to_version;
22   DBIx::Class::DeploymentHandler::VersionHandler::Monotonic->new($args);
23 }
24
25 1;
26
27 __END__
28
29 vim: ts=2 sw=2 expandtab