- Fix typos in POD and comments (RT#87644)
- Don't ship MYMETA.* files (RT#87713)
- Fix many_to_many bridges involving might_have relationships
+ - Allow specifying custom attributes for many_to_many bridges
0.07036 2013-07-08
- Fix stray comma in Pg on_delete/on_update => CASCADE (RT#84706)
$class1_to_class2_relname,
$class1_to_link_table_rel_name,
$class1_link_rel,
+ $self->_relationship_attrs('many_to_many', {}, {
+ rel_type => 'many_to_many',
+ rel_name => $class1_to_class2_relname,
+ local_source => $self->schema->source($class1_local_moniker),
+ remote_source => $self->schema->source($class1_remote_moniker),
+ local_table => $self->loader->class_to_table->{$class1},
+ local_cols => \@class1_from_cols,
+ remote_table => $self->loader->class_to_table->{$class2},
+ remote_cols => \@class2_from_cols,
+ }) || (),
],
extra => {
local_class => $class1,
$class2_to_class1_relname,
$class2_to_link_table_rel_name,
$class2_link_rel,
+ $self->_relationship_attrs('many_to_many', {}, {
+ rel_type => 'many_to_many',
+ rel_name => $class2_to_class1_relname,
+ local_source => $self->schema->source($class2_local_moniker),
+ remote_source => $self->schema->source($class2_remote_moniker),
+ local_table => $self->loader->class_to_table->{$class2},
+ local_cols => \@class2_from_cols,
+ remote_table => $self->loader->class_to_table->{$class1},
+ remote_cols => \@class1_from_cols,
+ }) || (),
],
extra => {
local_class => $class2,
$num_rescans++ if $self->{vendor} eq 'Firebird';
plan tests => @connect_info *
- (221 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
+ (223 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
foreach my $info_idx (0..$#connect_info) {
my $info = $connect_info[$info_idx];
) : (),
col_collision_map => { '^(can)\z' => 'caught_collision_%s' },
rel_collision_map => { '^(set_primary_key)\z' => 'caught_rel_collision_%s' },
+ relationship_attrs => { many_to_many => { order_by => 'me.id' } },
col_accessor_map => \&test_col_accessor_map,
result_components_map => { LoaderTest2X => 'TestComponentForMap', LoaderTest1 => '+TestComponentForMapFQN' },
uniq_to_primary => 1,
is $m2m->{relation}, 'loader_test20s', 'm2m near has_many rel';
is $m2m->{foreign_relation}, 'child', 'm2m far rel';
+ is $m2m->{attrs}->{order_by}, 'me.id', 'm2m bridge attrs';
ok($m2m = (try { $class19->_m2m_metadata->{parents} }), 'many_to_many created');
is $m2m->{relation}, 'loader_test20', 'm2m near might_have rel';
is $m2m->{foreign_relation}, 'parent', 'm2m far rel';
+ is $m2m->{attrs}->{order_by}, 'me.id', 'm2m bridge attrs';
# test double multi-col fk 26 -> 25
my $obj26 = try { $rsobj26->find(33) } || $rsobj26->search({ id => 33 })->single;