Parser correct; test includes failure, shorter query tests; new test schema for bad...
[dbsrgits/DBIx-Class.git] / t / lib / ViewDepsBad / Result / CD.pm
1 package    # hide from PAUSE
2     ViewDepsBad::Result::CD;
3
4 use strict;
5 use warnings;
6 use base 'DBIx::Class::Core';
7
8 __PACKAGE__->table('cd');
9
10 __PACKAGE__->add_columns(
11     id            => { data_type => 'integer', is_auto_increment => 1 },
12     title         => { data_type => 'text' },
13     artist        => { data_type => 'integer', is_nullable       => 0 },
14     year          => { data_type => 'integer' },
15     number_tracks => { data_type => 'integer' },
16 );
17
18 __PACKAGE__->set_primary_key('id');
19
20 __PACKAGE__->belongs_to( 'artist', 'ViewDepsBad::Result::Artist',
21     { "foreign.id" => "self.artist" },
22 );
23
24 __PACKAGE__->has_many( 'tracks', 'ViewDepsBad::Result::Track',
25     { "foreign.cd" => "self.id" },
26 );
27
28 1;