working tests with actual version handling
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithDatabaseToSchemaVersions.pm
CommitLineData
e70a1600 1package DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions;
2use Moose::Role;
3
4use DBIx::Class::DeploymentHandler::DatabaseToSchemaVersions;
5
6use Carp 'carp';
7
8has 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
38bd9956 16 does => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
e70a1600 17 is => 'ro',
18 lazy_build => 1,
38bd9956 19 handles => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
e70a1600 20);
21
22sub _build_version_handler {
23 my $self = shift;
38bd9956 24
25 my $args = {
e70a1600 26 schema => $self->schema,
38bd9956 27 };
28
29 $args->{to_version} = $self->to_version if $self->has_to_version;
30 DBIx::Class::DeploymentHandler::DatabaseToSchemaVersions->new($args);
e70a1600 31}
32
331;
34
35__END__
36
37vim: ts=2 sw=2 expandtab