Count warnings differently, as SQLT produces some weird stuff under 5.10. All of...
[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,
33 on_delete => undef,
34 on_update => 'SET NULL',
35});
ff657a43 36
37__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
38__PACKAGE__->has_many(
39 tags => 'DBICTest::Schema::Tag', undef,
40 { order_by => 'tag' },
41);
42__PACKAGE__->has_many(
43 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
44);
45
46__PACKAGE__->might_have(
47 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
48 { proxy => [ qw/notes/ ] },
49);
50__PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
51__PACKAGE__->many_to_many(
52 producers_sorted => cd_to_producer => 'producer',
53 { order_by => 'producer.name' },
54);
a02675cd 55
370f2ba2 56__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre', { 'foreign.genreid' => 'self.genreid' });
57
58#__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
59# { 'foreign.genreid' => 'self.genreid' },
60# { 'accessor' => 'single' }
61#);
62
a02675cd 631;