9 my $schema = DBICTest->init_schema();
11 my $cd = $schema->resultset("CD")->find(1);
14 $schema->is_executed_querycount( sub {
20 }, 'liner_notes (might_have) not prefetched - do not load liner_notes on update' );
22 my $cd2 = $schema->resultset("CD")->find(2, {prefetch => 'liner_notes'});
25 $schema->is_executed_querycount( sub {
31 }, 'liner_notes (might_have) prefetched - do not load liner_notes on update');
34 local $ENV{DBIC_DONT_VALIDATE_RELS};
36 DBICTest::Schema::Bookmark->might_have(
37 linky => 'DBICTest::Schema::Link',
38 { "foreign.id" => "self.link" },
41 qr{"might_have/has_one" must not be on columns with is_nullable set to true},
42 'might_have should warn if the self.id column is nullable';
45 local $ENV{DBIC_DONT_VALIDATE_RELS} = 1;
47 DBICTest::Schema::Bookmark->might_have(
48 slinky => 'DBICTest::Schema::Link',
49 { "foreign.id" => "self.link" },
53 'Setting DBIC_DONT_VALIDATE_RELS suppresses nullable relation warnings';