- Fix typos in POD and comments (RT#87644)
- Don't ship MYMETA.* files (RT#87713)
+ - Fix many_to_many bridges involving might_have relationships
0.07036 2013-07-08
- Fix stray comma in Pg on_delete/on_update => CASCADE (RT#84706)
my $class2 = $rels->[1]{args}[1];
my $class1_to_link_table_rel = first {
- $_->{method} eq 'has_many' && $_->{args}[1] eq $class
+ $_->{method} =~ /\A(?:has_many|might_have)\z/ && $_->{args}[1] eq $class
} @{ $all_code->{$class1} };
my $class1_to_link_table_rel_name = $class1_to_link_table_rel->{args}[0];
my $class2_to_link_table_rel = first {
- $_->{method} eq 'has_many' && $_->{args}[1] eq $class
+ $_->{method} =~ /\A(?:has_many|might_have)\z/ && $_->{args}[1] eq $class
} @{ $all_code->{$class2} };
my $class2_to_link_table_rel_name = $class2_to_link_table_rel->{args}[0];
ok($m2m = (try { $class18->_m2m_metadata->{children} }), 'many_to_many created');
- is $m2m->{relation}, 'loader_test20s', 'm2m near rel';
+ is $m2m->{relation}, 'loader_test20s', 'm2m near has_many rel';
is $m2m->{foreign_relation}, 'child', 'm2m far rel';
ok($m2m = (try { $class19->_m2m_metadata->{parents} }), 'many_to_many created');
- is $m2m->{relation}, 'loader_test20s', 'm2m near rel';
+ is $m2m->{relation}, 'loader_test20', 'm2m near might_have rel';
is $m2m->{foreign_relation}, 'parent', 'm2m far rel';
# test double multi-col fk 26 -> 25
qq{
CREATE TABLE loader_test20 (
parent INTEGER NOT NULL,
- child INTEGER NOT NULL,
+ child INTEGER NOT NULL UNIQUE,
PRIMARY KEY (parent, child),
FOREIGN KEY (parent) REFERENCES loader_test18 (id),
FOREIGN KEY (child) REFERENCES loader_test19 (id)