initial cut of deprecated bundle
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / Deprecated.pm
diff --git a/lib/DBIx/Class/DeploymentHandler/Deprecated.pm b/lib/DBIx/Class/DeploymentHandler/Deprecated.pm
new file mode 100644 (file)
index 0000000..5024417
--- /dev/null
@@ -0,0 +1,32 @@
+package DBIx::Class::DeploymentHandler::Deprecated;
+
+use Moose;
+use Moose::Util 'apply_all_roles';
+
+extends 'DBIx::Class::DeploymentHandler::Dad';
+with 'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedSqltDeployMethod',
+     'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedVersionStorage';
+
+sub BUILD {
+  my $self = shift;
+
+  if ($self->schema->can('ordered_versions')) {
+    apply_all_roles(
+      $self,
+      'DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions'
+    );
+  } else {
+    apply_all_roles(
+      $self,
+      'DBIx::Class::DeploymentHandler::WithExplicitVersions'
+    );
+  }
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__
+
+vim: ts=2 sw=2 expandtab