File: ForceForeign.pm

package info (click to toggle)
libdbix-class-perl 0.08010-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,052 kB
  • ctags: 1,064
  • sloc: perl: 10,536; sql: 225; makefile: 45
file content (32 lines) | stat: -rw-r--r-- 735 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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.artist_id' => '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,
			},
);

1;