disallow undef in versions
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionHandler / ExplicitVersions.pm
index 60b01ff..625e2f6 100644 (file)
@@ -1,5 +1,8 @@
 package DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions;
 use Moose;
+
+# ABSTRACT: Define your own list of versions to use for migrations
+
 use Carp 'croak';
 
 with 'DBIx::Class::DeploymentHandler::HandlesVersioning';
@@ -18,6 +21,7 @@ has database_version => (
 
 has to_version => (
   is         => 'ro',
+  isa        => 'Str',
   lazy_build => 1,
 );
 
@@ -90,8 +94,8 @@ sub previous_version_set {
   } else {
     my $next_idx = $self->_dec_version_idx;
     return [
-      $self->ordered_versions->[$next_idx    ],
       $self->ordered_versions->[$next_idx + 1],
+      $self->ordered_versions->[$next_idx    ],
     ];
   }
 }