X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FTrack.pm;h=e3f731ec2617925336c38ee5f5d6cb9ce30b5872;hb=67c438630af58cb7032da2206200a6247eabdff3;hp=2e6fa7f57977838395314080a404b09bfd64137a;hpb=22b15c96c84ddc1aeddddac637ca4c59a6465dcf;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest/Schema/Track.pm b/t/lib/DBICTest/Schema/Track.pm index 2e6fa7f..e3f731e 100644 --- a/t/lib/DBICTest/Schema/Track.pm +++ b/t/lib/DBICTest/Schema/Track.pm @@ -1,9 +1,45 @@ -package DBICTest::Schema::Track; +package # hide from PAUSE + DBICTest::Schema::Track; use base 'DBIx::Class::Core'; +__PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/); -DBICTest::Schema::Track->table('track'); -DBICTest::Schema::Track->add_columns(qw/trackid cd position title/); -DBICTest::Schema::Track->set_primary_key('trackid'); +__PACKAGE__->table('track'); +__PACKAGE__->add_columns( + 'trackid' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'cd' => { + data_type => 'integer', + }, + 'position' => { + data_type => 'integer', + accessor => 'pos', + }, + 'title' => { + data_type => 'varchar', + size => 100, + }, + last_updated_on => { + data_type => 'datetime', + accessor => 'updated_date', + is_nullable => 1 + }, +); +__PACKAGE__->set_primary_key('trackid'); + +__PACKAGE__->add_unique_constraint([ qw/cd position/ ]); +__PACKAGE__->add_unique_constraint([ qw/cd title/ ]); + +__PACKAGE__->position_column ('position'); +__PACKAGE__->grouping_column ('cd'); + + +__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' ); +__PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd'); + +__PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' ); +__PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' ); 1;