Skip Menu |
 

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

Report information
The Basics
Id: 35393
Status: resolved
Priority: 0/
Queue: DBIx-Migration

People
Owner: Nobody in particular
Requestors: hirayama [...] fractalist.jp
Cc:
AdminCc:

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



Subject: bug report of DBIx::Migration
Date: Fri, 25 Apr 2008 12:53:53 +0900
To: <bug-DBIx-Migration [...] rt.cpan.org>
From: "HIRAYAMA, Takayuki" <hirayama [...] fractalist.jp>
Download (untitled) / with headers
text/plain 1.5k
Hello. = Environment Info: * Distribution name and version: DBIx::Migration-0.0.5 * Perl version: 5.8.5 * Operating System vendor and version: Linux 2.6.9-55.ELsmp #1 SMP Wed May 2 14:28:44 EDT 2007 i686 athlon i386 GNU/Linux I found bug in DBIx::Migration. It is so useful, but not works for migrate directory containing sql files over 10 files because code in sub _files describes: sub _files { my ( $self, $type, $need ) = @_; my @files; for my $i (@$need) { opendir(DIR, $self->dir) or die $!; while (my $file = readdir(DIR)) { next unless $file =~ /${i}_$type\.sql$/; $file = File::Spec->catdir($self->dir, $file); push @files, { name => $file, version => $i }; } closedir(DIR); } return undef unless @$need == @files; return @files ? \@files : undef; } If xxx_1.sql and xxx_11.sql are included for the directory, both files are pushed to @files and undef returned because @$need does not match @files. I made and tried the following patch, and behaved correctly. --- Migration.pm.bak 2008-04-25 12:24:53.000000000 +0900 +++ Migration.pm 2008-04-25 12:25:46.000000000 +0900 @@ -190,7 +190,7 @@ for my $i (@$need) { opendir(DIR, $self->dir) or die $!; while (my $file = readdir(DIR)) { - next unless $file =~ /${i}_$type\.sql$/; + next unless $file =~ /(^|\D)${i}_$type\.sql$/; $file = File::Spec->catdir($self->dir, $file); push @files, { name => $file, version => $i }; } Sorry for my poor English:-) Regars,
Fixed in 0.6 on it's way to CPAN


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.