Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Year1999CDs.pm
1 package # hide from PAUSE
2     DBICTest::Schema::Year1999CDs;
3 ## Used in 104view.t
4
5 use warnings;
6 use strict;
7
8 use base qw/DBICTest::BaseResult/;
9
10 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
11
12 __PACKAGE__->table('year1999cds');
13 __PACKAGE__->result_source_instance->is_virtual(1);
14 __PACKAGE__->result_source_instance->view_definition(
15   "SELECT cdid, artist, title, single_track FROM cd WHERE year ='1999'"
16 );
17 __PACKAGE__->add_columns(
18   'cdid' => {
19     data_type => 'integer',
20     is_auto_increment => 1,
21   },
22   'artist' => {
23     data_type => 'integer',
24   },
25   'title' => {
26     data_type => 'varchar',
27     size      => 100,
28   },
29   'single_track' => {
30     data_type => 'integer',
31     is_nullable => 1,
32     is_foreign_key => 1,
33   },
34 );
35 __PACKAGE__->set_primary_key('cdid');
36 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
37
38 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
39 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
40     { "foreign.cd" => "self.cdid" });
41
42 1;