Revision history for Perl extension DBIx::Class::Schema::Loader
+ - sort relationships so they always come out in the same order
- add rel_name_map option
- fix the decimal data type for MS Access over ODBC
- fix enum/set detection for MySQL (RT#68717)
- add result_roles and schema_roles for use with use_moose=1
- generate Schema/ResultBase.pm and Schema/ResultSetBase.pm
- remove additional warnings skip in t/22dump.t for ActivePerl on Win32
+ - make 23dumpmore.t auto cleanup and remove dump warnings
- Relationships
- Re-scan relations/tables after initial relation setup to find
my $rel_stmts = $self->_relbuilder->generate_code(\@tables);
foreach my $src_class (sort keys %$rel_stmts) {
- my $src_stmts = $rel_stmts->{$src_class};
- foreach my $stmt (@$src_stmts) {
- $self->_dbic_stmt($src_class,$stmt->{method},@{$stmt->{args}});
+ # sort by rel name
+ my @src_stmts = map $_->[1],
+ sort { $a->[0] cmp $b->[0] }
+ map [ $_->{args}[0], $_ ], @{ $rel_stmts->{$src_class} };
+
+ foreach my $stmt (@src_stmts) {
+ $self->_dbic_stmt($src_class,$stmt->{method}, @{$stmt->{args}});
}
}
}
$t->cleanup;
+# test that rels are sorted
+$t->dump_test(
+ classname => 'DBICTest::Schema::_sorted_rels',
+ test_db_class => 'make_dbictest_db_with_unique',
+ warnings => [
+ qr/Dumping manual schema for DBICTest::Schema::_sorted_rels to directory /,
+ qr/Schema dump completed/,
+ ],
+ regexes => {
+ Baz => [
+ qr/->might_have\(\n "quux".*->belongs_to\(\n "station_visited"/s,
+ ],
+ }
+);
+
+$t->cleanup;
+
# test naming => { monikers => 'plural' }
$t->dump_test(
classname => 'DBICTest::Schema::_plural_monikers',