| 1 | package DBIO::Test::Schema::ForceForeign; | ||
| 2 | # ABSTRACT: Test result class for the forceforeign table | ||
| 3 | |||
| 4 | 256 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 256 | our $VERSION = '0.900007'; | |
| 7 | |||
| 8 | 256 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 256 | ▶ | use base qw/DBIO::Test::BaseResult/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 256 | __PACKAGE__->table('forceforeign'); | |
| 13 | 256 | __PACKAGE__->add_columns( | |
| 14 | 'artist' => { data_type => 'integer' }, | ||
| 15 | 'cd' => { data_type => 'integer' }, | ||
| 16 | ); | ||
| 17 | 256 | __PACKAGE__->set_primary_key(qw/artist/); | |
| 18 | |||
| 19 | # Normally this would not appear as a FK constraint | ||
| 20 | # since it uses the PK | ||
| 21 | 256 | __PACKAGE__->might_have('artist_1', 'DBIO::Test::Schema::Artist', 'artistid', | |
| 22 | { is_foreign_key_constraint => 1 }, | ||
| 23 | ); | ||
| 24 | |||
| 25 | # Normally this would appear as a FK constraint | ||
| 26 | 256 | __PACKAGE__->might_have('cd_1', 'DBIO::Test::Schema::CD', | |
| 27 | { 'foreign.cdid' => 'self.cd' }, | ||
| 28 | { is_foreign_key_constraint => 0 }, | ||
| 29 | ); | ||
| 30 | |||
| 31 | # Normally this would appear as a FK constraint | ||
| 32 | 256 | __PACKAGE__->belongs_to('cd_3', 'DBIO::Test::Schema::CD', | |
| 33 | { 'foreign.cdid' => 'self.cd' }, | ||
| 34 | { is_foreign_key_constraint => 0 }, | ||
| 35 | ); | ||
| 36 | |||
| 37 | 256 | 1; | |
| 38 | |||
| 39 | __END__ | ||