Commit | Line | Data |
5b0b10fe |
1 | package # hide from PAUSE |
2 | DBICTest::Schema::ForceForeign; |
3 | |
4a233f30 |
4 | use warnings; |
5 | use strict; |
6 | |
660cf1be |
7 | use base qw/DBICTest::BaseResult/; |
5b0b10fe |
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 |
a705b175 |
18 | __PACKAGE__->might_have('artist_1', 'DBICTest::Schema::Artist', |
19 | { 'foreign.artistid' => 'self.artist' }, |
20 | { is_foreign_key_constraint => 1 }, |
5b0b10fe |
21 | ); |
22 | |
23 | # Normally this would appear as a FK constraint |
a705b175 |
24 | __PACKAGE__->might_have('cd_1', 'DBICTest::Schema::CD', |
25 | { 'foreign.cdid' => 'self.cd' }, |
26 | { is_foreign_key_constraint => 0 }, |
5b0b10fe |
27 | ); |
28 | |
6bf6ba2f |
29 | # Normally this would appear as a FK constraint |
a705b175 |
30 | __PACKAGE__->belongs_to('cd_3', 'DBICTest::Schema::CD', |
31 | { 'foreign.cdid' => 'self.cd' }, |
32 | { is_foreign_key_constraint => 0 }, |
6bf6ba2f |
33 | ); |
34 | |
5b0b10fe |
35 | 1; |