whitespace
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / WithSqltDeployMethod.pm
index 62e854b..9ff8417 100644 (file)
@@ -26,7 +26,7 @@ has databases => (
   default => sub { [qw( MySQL SQLite PostgreSQL )] },
 );
 
-has sqltargs => (
+has sql_translator_args => (
   isa => 'HashRef',
   is  => 'ro',
   default => sub { {} },
@@ -34,12 +34,15 @@ has sqltargs => (
 
 sub _build_deploy_method {
   my $self = shift;
-  DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator->new({
-    schema            => $self->schema,
-    databases         => $self->databases,
-    upgrade_directory => $self->upgrade_directory,
-    sqltargs          => $self->sqltargs,
-  });
+  my $args = {
+    schema              => $self->schema,
+    databases           => $self->databases,
+    upgrade_directory   => $self->upgrade_directory,
+    sql_translator_args => $self->sql_translator_args,
+  };
+
+  $args->{schema_version} = $self->schema_version if $self->has_schema_version;
+  DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator->new($args);
 }
 
 1;
@@ -47,3 +50,9 @@ sub _build_deploy_method {
 # vim: ts=2 sw=2 expandtab
 
 __END__
+
+=head1 DELEGATION ROLE
+
+This role is entirely for making delegation look like a role.  The actual
+docs for the methods and attributes are at
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>