Revision history for Perl extension DBIx::Class::Schema::Loader
+ - allow user to set qualify_objects=0 in multischema configurations
+
0.07029 2012-09-05 16:41:56
- Oracle: introspect ON DELETE and DEFERRABLE FK clauses
- Oracle WARNING: on_delete is now 'NO ACTION' by default, not
angelixd: Paul C. Mantz <pcmantz@cpan.org>
+andrewalker: André Walker <andre@andrewalker.net>
+
... and lots of other folks. If we forgot you, please write the current
maintainer or RT.
Set to true to prepend the L</db_schema> to table names for C<<
__PACKAGE__->table >> calls, and to some other things like Oracle sequences.
-This attribute is automatically set to true for multi db_schema configurations.
+This attribute is automatically set to true for multi db_schema configurations,
+unless explicitly set to false by the user.
=head2 use_moose
if (defined $self->db_schema) {
if (ref $self->db_schema eq 'ARRAY') {
- if (@{ $self->db_schema } > 1) {
+ if (@{ $self->db_schema } > 1 && not defined $self->{qualify_objects}) {
$self->{qualify_objects} = 1;
}
elsif (@{ $self->db_schema } == 0) {
}
}
elsif (not ref $self->db_schema) {
- if ($self->db_schema eq '%') {
+ if ($self->db_schema eq '%' && not defined $self->{qualify_objects}) {
$self->{qualify_objects} = 1;
}
},
);
+# test qualify_objects
+$t->dump_test(
+ classname => 'DBICTest::DumpMore::1',
+ options => {
+ db_schema => [ 'foo_schema', 'bar_schema' ],
+ qualify_objects => 0,
+ use_namespaces => 1,
+ },
+ warnings => [
+ qr/^db_schema is not supported on SQLite/,
+ ],
+ regexes => {
+ 'Result/Foo' => [
+ # the table name should not include the db schema
+ qr/^\Q__PACKAGE__->table("foo");\E/m,
+ ],
+ 'Result/Bar' => [
+ # the table name should not include the db schema
+ qr/^\Q__PACKAGE__->table("bar");\E/m,
+ ],
+ },
+);
+
# test moniker_parts
$t->dump_test(
classname => 'DBICTest::DumpMore::1',