X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FForceForeign.pm;fp=t%2Flib%2FDBICTest%2FSchema%2FForceForeign.pm;h=82829b8d05d4b3f1bb3a4955e50da250a9a94c4b;hp=0000000000000000000000000000000000000000;hb=584713f437ffa9390821a0580ed368aa22fb552e;hpb=d93b1239cb7de482ac79a091d7daa67115596306 diff --git a/t/lib/DBICTest/Schema/ForceForeign.pm b/t/lib/DBICTest/Schema/ForceForeign.pm new file mode 100644 index 0000000..82829b8 --- /dev/null +++ b/t/lib/DBICTest/Schema/ForceForeign.pm @@ -0,0 +1,41 @@ +package # hide from PAUSE + DBICTest::Schema::ForceForeign; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('forceforeign'); +__PACKAGE__->add_columns( + 'artist' => { data_type => 'integer' }, + 'cd' => { data_type => 'integer' }, +); +__PACKAGE__->set_primary_key(qw/artist/); + +# Normally this would not appear as a FK constraint +# since it uses the PK +__PACKAGE__->might_have( + 'artist_1', 'DBICTest::Schema::Artist', { + 'foreign.artistid' => 'self.artist', + }, { + is_foreign_key_constraint => 1, + }, +); + +# Normally this would appear as a FK constraint +__PACKAGE__->might_have( + 'cd_1', 'DBICTest::Schema::CD', { + 'foreign.cdid' => 'self.cd', + }, { + is_foreign_key_constraint => 0, + }, +); + +# Normally this would appear as a FK constraint +__PACKAGE__->belongs_to( + 'cd_3', 'DBICTest::Schema::CD', { + 'foreign.cdid' => 'self.cd', + }, { + is_foreign_key_constraint => 0, + }, +); + +1;