Augment test suite with oddball relationship declarations
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / ForceForeign.pm
1 package # hide from PAUSE
2     DBICTest::Schema::ForceForeign;
3
4 use warnings;
5 use strict;
6
7 use base qw/DBICTest::BaseResult/;
8
9 __PACKAGE__->table('forceforeign');
10 __PACKAGE__->add_columns(
11   'artist' => { data_type => 'integer' },
12   'cd' => { data_type => 'integer' },
13 );
14 __PACKAGE__->set_primary_key(qw/artist/);
15
16 # Normally this would not appear as a FK constraint
17 # since it uses the PK
18 __PACKAGE__->might_have('artist_1', 'DBICTest::Schema::Artist', 'artistid',
19   { is_foreign_key_constraint => 1 },
20 );
21
22 # Normally this would appear as a FK constraint
23 __PACKAGE__->might_have('cd_1', 'DBICTest::Schema::CD',
24   { 'foreign.cdid' => 'self.cd' },
25   { is_foreign_key_constraint => 0 },
26 );
27
28 # Normally this would appear as a FK constraint
29 __PACKAGE__->belongs_to('cd_3', 'DBICTest::Schema::CD',
30   { 'foreign.cdid' => 'self.cd' },
31   { is_foreign_key_constraint => 0 },
32 );
33
34 1;