X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FBase.pm;h=3ff501a714387b171ae79b07e21a0534193fb94b;hb=ca1389c8998c1646875df6f64494f5ff49153420;hp=923209cc45f65b899683d19ef795c533ce335efb;hpb=d7e0e0e8e9517098567f1a5637771505476ccbc1;p=dbsrgits%2FDBIx-Class-Schema-Loader.git
diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm
index 923209c..3ff501a 100644
--- a/lib/DBIx/Class/Schema/Loader/Base.pm
+++ b/lib/DBIx/Class/Schema/Loader/Base.pm
@@ -30,7 +30,7 @@ use List::Util qw/all any none/;
use File::Temp 'tempfile';
use namespace::clean;
-our $VERSION = '0.07045';
+our $VERSION = '0.07046';
__PACKAGE__->mk_group_ro_accessors('simple', qw/
schema
@@ -561,10 +561,6 @@ database and/or schema.
Only load matching tables.
-=head2 exclude
-
-Exclude matching tables.
-
These can be specified either as a regex (preferably on the C
form), or as an arrayref of arrayrefs. Regexes are matched against
the (unqualified) table name, while arrayrefs are matched according to
@@ -582,6 +578,13 @@ For example:
In this case only the tables C and C in C and
C in C will be dumped.
+=head2 exclude
+
+Exclude matching tables.
+
+The tables to exclude are specified in the same way as for the
+L option.
+
=head2 moniker_map
Overrides the default table name to moniker translation. Either
@@ -1985,7 +1988,8 @@ sub _dump_to_dir {
my @attr = qw/resultset_namespace default_resultset_class/;
- unshift @attr, 'result_namespace' unless (not $self->result_namespace) || $self->result_namespace eq 'Result';
+ unshift @attr, 'result_namespace'
+ if $self->result_namespace && $self->result_namespace ne 'Result';
for my $attr (@attr) {
if ($self->$attr) {
@@ -2252,9 +2256,16 @@ sub _parse_generated_file {
$gen .= $pre_md5;
$real_md5 = Digest::MD5::md5_base64(encode 'UTF-8', $gen);
- croak "Checksum mismatch in '$fn', the auto-generated part of the file has been modified outside of this loader. Aborting.\nIf you want to overwrite these modifications, set the 'overwrite_modifications' loader option.\n"
- if !$self->overwrite_modifications && $real_md5 ne $mark_md5;
-
+ if ($real_md5 ne $mark_md5) {
+ if ($self->overwrite_modifications) {
+ # Setting this to something that is not a valid MD5 forces
+ # the file to be rewritten.
+ $real_md5 = 'not an MD5';
+ }
+ else {
+ croak "Checksum mismatch in '$fn', the auto-generated part of the file has been modified outside of this loader. Aborting.\nIf you want to overwrite these modifications, set the 'overwrite_modifications' loader option.\n";
+ }
+ }
last;
}
else {