1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
11 my $schema = DBICTest->init_schema();
13 my $cd = $schema->resultset("CD")->find(1);
16 $schema->is_executed_querycount( sub {
22 }, 'liner_notes (might_have) not prefetched - do not load liner_notes on update' );
24 my $cd2 = $schema->resultset("CD")->find(2, {prefetch => 'liner_notes'});
27 $schema->is_executed_querycount( sub {
33 }, 'liner_notes (might_have) prefetched - do not load liner_notes on update');
36 local $ENV{DBIC_DONT_VALIDATE_RELS};
38 DBICTest::Schema::Bookmark->might_have(
39 linky => 'DBICTest::Schema::Link',
40 { "foreign.id" => "self.link" },
43 qr{"might_have/has_one" must not be on columns with is_nullable set to true},
44 'might_have should warn if the self.id column is nullable';
47 local $ENV{DBIC_DONT_VALIDATE_RELS} = 1;
49 DBICTest::Schema::Bookmark->might_have(
50 slinky => 'DBICTest::Schema::Link',
51 { "foreign.id" => "self.link" },
55 'Setting DBIC_DONT_VALIDATE_RELS suppresses nullable relation warnings';