(no commit message)
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Artist.pm
1 package # hide from PAUSE 
2     DBICTest::Schema::Artist;
3
4 use base 'DBIx::Class::Core';
5
6 __PACKAGE__->table('artist');
7 __PACKAGE__->source_info({
8     "source_info_key_A" => "source_info_value_A",
9     "source_info_key_B" => "source_info_value_B",
10     "source_info_key_C" => "source_info_value_C",
11 });
12 __PACKAGE__->add_columns(
13   'artistid' => {
14     data_type => 'integer',
15     is_auto_increment => 1,
16         bind_attributes => { testkey1 => 1},
17   },
18   'name' => {
19     data_type => 'varchar',
20     size      => 100,
21     is_nullable => 1,
22         bind_attributes => {testkey2 =>2},
23   },
24 );
25 __PACKAGE__->set_primary_key('artistid');
26
27 __PACKAGE__->mk_classdata('field_name_for', {
28     artistid    => 'primary key',
29     name        => 'artist name',
30 });
31
32 __PACKAGE__->has_many(
33     cds => 'DBICTest::Schema::CD', undef,
34     { order_by => 'year' },
35 );
36
37 __PACKAGE__->has_many( twokeys => 'DBICTest::Schema::TwoKeys' );
38 __PACKAGE__->has_many( onekeys => 'DBICTest::Schema::OneKey' );
39
40 __PACKAGE__->has_many(
41   artist_undirected_maps => 'DBICTest::Schema::ArtistUndirectedMap',
42   [ {'foreign.id1' => 'self.artistid'}, {'foreign.id2' => 'self.artistid'} ],
43   { cascade_copy => 0 } # this would *so* not make sense
44 );
45
46 1;