Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | DBICTest::Schema::ArtistUndirectedMap; |
5efe4c79 |
3 | |
660cf1be |
4 | use base qw/DBICTest::BaseResult/; |
5efe4c79 |
5 | |
6 | __PACKAGE__->table('artist_undirected_map'); |
0009fa49 |
7 | __PACKAGE__->add_columns( |
8 | 'id1' => { data_type => 'integer' }, |
9 | 'id2' => { data_type => 'integer' }, |
10 | ); |
5efe4c79 |
11 | __PACKAGE__->set_primary_key(qw/id1 id2/); |
12 | |
e377d723 |
13 | __PACKAGE__->belongs_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} ); |
b230b4be |
14 | __PACKAGE__->belongs_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} ); |
ff657a43 |
15 | __PACKAGE__->has_many( |
16 | 'mapped_artists', 'DBICTest::Schema::Artist', |
17 | [ {'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'} ], |
51c9ead2 |
18 | { cascade_delete => 0 }, |
ff657a43 |
19 | ); |
20 | |
5efe4c79 |
21 | 1; |