Commit | Line | Data |
e70a1600 |
1 | package DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions; |
2 | use Moose::Role; |
3 | |
9deabd1f |
4 | # ABSTRACT: Delegate/Role for DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions |
5 | |
c703d15d |
6 | use DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions; |
e70a1600 |
7 | |
8 | use Carp 'carp'; |
9 | |
10 | has version_handler => ( |
24f4524b |
11 | is => 'ro', |
e70a1600 |
12 | lazy_build => 1, |
24f4524b |
13 | does => 'DBIx::Class::DeploymentHandler::HandlesVersioning', |
14 | handles => 'DBIx::Class::DeploymentHandler::HandlesVersioning', |
e70a1600 |
15 | ); |
16 | |
17 | sub _build_version_handler { |
18 | my $self = shift; |
38bd9956 |
19 | |
20 | my $args = { |
b539a216 |
21 | database_version => $self->database_version, |
22 | schema_version => $self->schema_version, |
38bd9956 |
23 | }; |
24 | |
25 | $args->{to_version} = $self->to_version if $self->has_to_version; |
c703d15d |
26 | DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions->new($args); |
e70a1600 |
27 | } |
28 | |
29 | 1; |
30 | |
e52174e3 |
31 | # vim: ts=2 sw=2 expandtab |
32 | |
e70a1600 |
33 | __END__ |
34 | |