From: John Napiorkowski Date: Thu, 22 Sep 2011 03:00:37 +0000 (-0400) Subject: fix to make reasonable defaults work X-Git-Tag: v0.001006~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d6d35e82d6a583dac11979c1a81a449c8385482;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git fix to make reasonable defaults work --- diff --git a/Changes b/Changes index 4e14685..8131408 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - Fix the reasonable defaults for downgrading (jnap) - Stop warning all the time (ribasushi) - croak on a couple errors that should be fatal - Stop deleting the wrong version (for downgrades) diff --git a/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm b/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm index 25afb2b..af38852 100644 --- a/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm +++ b/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm @@ -24,8 +24,8 @@ around prepare_downgrade => sub { my $args = shift || {}; - $args->{from_version} ||= $self->database_version; - $args->{to_version} ||= $self->schema_version; + $args->{to_version} ||= $self->database_version; + $args->{from_version} ||= $self->schema_version; $args->{version_set} ||= [$args->{from_version}, $args->{to_version}]; $self->$orig($args); @@ -65,9 +65,9 @@ Defaulted args: Defaulted args: - my $from_version = $self->database_version; - my $to_version = $self->schema_version; - my $version_set = [$to_version]; + my $from_version = $self->schema_version; + my $to_version = $self->data_version; + my $version_set = [$from_version, $to_version]; =head2 install_resultsource