- Properly detect a schema loaded with use_moose on subsequent
reloads
+ - Die with a sensible message when a schema loaded with
+ use_moose => 1 is reloaded with use_moose => 0
- Switch to MRO::Compat
- Fix oracle common tests failure / lc(undef) warnings
- Bump Moose/Moosex::NonMoose optional dependencies to fixed-up
$custom_content .= $self->_default_custom_content;
}
}
+ elsif (defined $self->use_moose && $old_gen) {
+ croak 'It is not possible to "downgrade" a schema that was loaded with use_moose => 1 to use_moose => 0, due to differing custom content'
+ if $old_gen =~ /use \s+ MooseX?\b/x;
+ }
$custom_content = $self->_rewrite_old_classnames($custom_content);
$t->dump_test(
classname => 'DBICTest::DumpMore::1',
options => {
+ use_moose => 0,
result_base_class => 'My::ResultBaseClass',
schema_base_class => 'My::SchemaBaseClass',
},
$t->cleanup;
-# now add the Moose custom content to unapgraded schema, and make sure it is not repeated
+# check with a fresh non-moose schema that Moose custom content added to unapgraded schema, and make sure it is not repeated
$t->dump_test(
classname => 'DBICTest::DumpMore::1',
options => {
);
}
+# check that a moose schema can *not* be downgraded
+
+$t->dump_test (
+ classname => 'DBICTest::DumpMore::1',
+ options => {
+ use_moose => 0,
+ result_base_class => 'My::ResultBaseClass',
+ schema_base_class => 'My::SchemaBaseClass',
+ },
+ warnings => [
+ qr/Dumping manual schema for DBICTest::DumpMore::1 to directory /,
+ ],
+ error => qr/\QIt is not possible to "downgrade" a schema that was loaded with use_moose => 1\E/,
+);
+
done_testing;