Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the DBIx-Migration CPAN distribution.

Report information
The Basics
Id: 107220
Status: new
Priority: 0/
Queue: DBIx-Migration

People
Owner: Nobody in particular
Requestors: sjenkin [...] venda.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Postgres Incompatibility
Date: Mon, 21 Sep 2015 16:56:10 +0100
To: bug-DBIx-Migration [...] rt.cpan.org
From: Steven Jenkin <sjenkin [...] venda.com>
Download (untitled) / with headers
text/plain 1.1k
= Environment Info: * Distribution name and version: DBIx::Migration-0.0.7 * Perl version: 5.16.2 * Postgres version 9.4.1 * Operating System vendor and version: Linux 2.6.32-504.1.3.el6.x86_64 1 SMP DBIx::Migration always generates a "Database is at version 1 , couldn't migrate to 2” error when used against a Postgres database. This is due to the version being stored as a CHAR(64) and therefore being padded with spaces. This space-padded value is then string compared to the expected value and will never match. The following fix appears to correct this: diff --git a/lib/DBIx/Migration.pm b/lib/DBIx/Migration.pm index a4c602d..3f1b164 100644 --- a/lib/DBIx/Migration.pm +++ b/lib/DBIx/Migration.pm @@ -76,7 +76,7 @@ sub migrate { $self->_connect; $wanted = $self->_newest unless defined $wanted; my $version = $self->_version; - if ( defined $version && ( $wanted eq $version ) ) { + if ( defined $version && ( $wanted == $version ) ) { print "Database is already at version $wanted\n" if $self->debug; return 1; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.