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