more complete backcompat tests, one last thing to do
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / Base.pm
index 5403cc2..16507e7 100644 (file)
@@ -385,6 +385,9 @@ Dynamic schema detected, will run in 0.04006 mode.
 
 Set the 'naming' attribute or the SCHEMA_LOADER_BACKCOMPAT environment variable
 to disable this warning.
+
+See perldoc DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 for more
+details.
 EOF
         }
 
@@ -405,15 +408,30 @@ EOF
         if (/^# Created by DBIx::Class::Schema::Loader v((\d+)\.(\d+))/) {
             my $real_ver = $1;
 
-            $self->schema_version_to_dump($real_ver);
-
             # XXX when we go past .0 this will need fixing
             my ($v) = $real_ver =~ /([1-9])/;
             $v = "v$v";
 
+            last if $v eq CURRENT_V;
+
+            if (not %{ $self->naming }) {
+                warn <<"EOF" unless $ENV{SCHEMA_LOADER_BACKCOMPAT};
+
+Version $real_ver static schema detected, turning on backcompat mode.
+
+Set the 'naming' attribute or the SCHEMA_LOADER_BACKCOMPAT environment variable
+to disable this warning.
+
+See perldoc DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 for more
+details.
+EOF
+            }
+
             $self->naming->{relationships} ||= $v;
             $self->naming->{monikers}      ||= $v;
 
+            $self->schema_version_to_dump($real_ver);
+
             last;
         }
     }