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