1 package # hide from PAUSE
2 DBICTest::Schema::Track;
4 use base qw/DBICTest::BaseResult/;
5 __PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/);
7 __PACKAGE__->table('track');
8 __PACKAGE__->add_columns(
10 data_type => 'integer',
11 is_auto_increment => 1,
14 data_type => 'integer',
21 data_type => 'varchar',
25 data_type => 'datetime',
26 accessor => 'updated_date',
30 data_type => 'datetime',
33 small_dt => { # for mssql and sybase DT tests
34 data_type => 'smalldatetime',
38 __PACKAGE__->set_primary_key('trackid');
40 __PACKAGE__->add_unique_constraint([ qw/cd position/ ]);
41 __PACKAGE__->add_unique_constraint([ qw/cd title/ ]);
43 __PACKAGE__->position_column ('position');
44 __PACKAGE__->grouping_column ('cd');
47 __PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );
48 __PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd');
50 __PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' );
51 __PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' );
53 __PACKAGE__->belongs_to(
55 "DBICTest::Schema::Year1999CDs",
56 { "foreign.cdid" => "self.cd" },
57 { join_type => 'left' }, # the relationship is of course optional
59 __PACKAGE__->belongs_to(
61 "DBICTest::Schema::Year2000CDs",
62 { "foreign.cdid" => "self.cd" },
63 { join_type => 'left' },