huge refactoring to clean up SQLTDM and allow running of arbitraty perl in upgrades...
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / Deprecated.pm
1 package DBIx::Class::DeploymentHandler::Deprecated;
2
3 use Moose;
4 use Moose::Util 'apply_all_roles';
5
6 extends 'DBIx::Class::DeploymentHandler::Dad';
7 # a single with would be better, but we can't do that
8 # see: http://rt.cpan.org/Public/Bug/Display.html?id=46347
9 with 'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedSqltDeployMethod',
10      'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedVersionStorage';
11 with 'DBIx::Class::DeploymentHandler::WithReasonableDefaults';
12
13 sub BUILD {
14   my $self = shift;
15
16   if ($self->schema->can('ordered_versions') && $self->schema->ordered_versions) {
17     apply_all_roles(
18       $self,
19       'DBIx::Class::DeploymentHandler::WithExplicitVersions'
20     );
21   } else {
22     apply_all_roles(
23       $self,
24       'DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions'
25     );
26   }
27 }
28
29 __PACKAGE__->meta->make_immutable;
30
31 1;
32
33 __END__
34
35 vim: ts=2 sw=2 expandtab