From: Luke Saunders Date: Wed, 24 Oct 2007 20:42:22 +0000 (+0000) Subject: fixed broken regex when reading sql files X-Git-Tag: v0.08240~545^2~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da153fe5d87ebbede9bd350afbd33e52be2f703e;p=dbsrgits%2FDBIx-Class.git fixed broken regex when reading sql files --- diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index da1afbc..e5493ce 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -184,7 +184,7 @@ sub upgrade my $diff = SQL::Translator::Diff::schema_diff($db_tr->schema, $db, $dbic_tr->schema, $db, - { ignore_constraint_names => 1, ignore_index_names => 1, caseopt => 1 }); + { caseopt => 1 }); my $filename = $self->ddl_filename( $db, @@ -226,7 +226,9 @@ sub upgrade my $fh; open $fh, "<$file" or warn("Can't open upgrade file, $file ($!)"); - my @data = split(/[;\n]/, join('', <$fh>)); + my @data = split(/\n/, join('', <$fh>)); + @data = grep(!/^--/, @data); + @data = split(/;/, join('', @data)); close($fh); @data = grep { $_ && $_ !~ /^-- / } @data; @data = grep { $_ !~ /^(BEGIN TRANACTION|COMMIT)/m } @data;