Revert castaway's test - mildly bogus
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / CD.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest::Schema::CD;
a02675cd 3
4use base 'DBIx::Class::Core';
5
ff657a43 6__PACKAGE__->table('cd');
7__PACKAGE__->add_columns(
0009fa49 8 'cdid' => {
9 data_type => 'integer',
10 is_auto_increment => 1,
11 },
12 'artist' => {
13 data_type => 'integer',
14 },
15 'title' => {
16 data_type => 'varchar',
cb561d1a 17 size => 100,
0009fa49 18 },
19 'year' => {
20 data_type => 'varchar',
cb561d1a 21 size => 100,
0009fa49 22 },
370f2ba2 23 'genreid' => {
4e0eaf64 24 data_type => 'integer',
25 is_nullable => 1,
370f2ba2 26 }
0009fa49 27);
ff657a43 28__PACKAGE__->set_primary_key('cdid');
368a5228 29__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
ff657a43 30
e377d723 31__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
32 is_deferrable => 1,
e377d723 33});
ff657a43 34
35__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
36__PACKAGE__->has_many(
37 tags => 'DBICTest::Schema::Tag', undef,
38 { order_by => 'tag' },
39);
40__PACKAGE__->has_many(
41 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
42);
43
44__PACKAGE__->might_have(
45 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
46 { proxy => [ qw/notes/ ] },
47);
48__PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
49__PACKAGE__->many_to_many(
50 producers_sorted => cd_to_producer => 'producer',
51 { order_by => 'producer.name' },
52);
a02675cd 53
87310237 54__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
55 { 'foreign.genreid' => 'self.genreid' },
a0dd8679 56 {
57 join_type => 'left',
58 on_delete => 'SET NULL',
59 on_update => 'CASCADE',
60
61 },
87310237 62);
370f2ba2 63
64#__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
65# { 'foreign.genreid' => 'self.genreid' },
66# { 'accessor' => 'single' }
67#);
68
a02675cd 691;