title => 'Bad investment',
year => 2008,
tracks => [
- { position => 1, title => 'Just buy' },
- { position => 2, title => 'Why did we do it' },
- { position => 3, title => 'Burn baby burn' },
+ { title => 'Just buy' },
+ { title => 'Why did we do it' },
+ { title => 'Burn baby burn' },
],
},
producer => {
year => 2008,
tracks => [
{
- position => 1, # some day me might test this with Ordered
title => 'Off by one again',
},
{
- position => 2,
title => 'The dereferencer',
cd_single => {
artist => $artist,
year => 2008,
title => 'Was that a null (Single)',
tracks => [
- { title => 'The dereferencer', position => 1 },
- { title => 'The dereferencer II', position => 2 },
+ { title => 'The dereferencer' },
+ { title => 'The dereferencer II' },
],
cd_to_producer => [
{
my $cd = $schema->resultset('CD')->first;
my $track = $schema->resultset('Track')->create ({
cd => $cd,
- position => 77, # some day me might test this with Ordered
title => 'Multicreate rocks',
cd_single => {
artist => $cd->artist,
year => 2008,
title => 'Disemboweling MultiCreate',
tracks => [
- { title => 'Why does mst write this way', position => 1 },
- { title => 'Chainsaw celebration', position => 2 },
- { title => 'Purl cleans up', position => 3 },
+ { title => 'Why does mst write this way' },
+ { title => 'Chainsaw celebration' },
+ { title => 'Purl cleans up' },
],
cd_to_producer => [
{
my $cd = $schema->resultset('CD')->first;
my $track = $schema->resultset ('Track')->create ({
cd => $cd,
- position => 66,
title => 'Black',
lyrics => {
lyric_versions => [
title => 'TestOneCD1',
year => 2007,
tracks => [
-
- { position=>111,
- title => 'TrackOne',
- },
- { position=>112,
- title => 'TrackTwo',
- }
+ { title => 'TrackOne' },
+ { title => 'TrackTwo' },
],
});
title => 'TestOneCD2',
year => 2007,
tracks => [
-
- { position=>111,
- title => 'TrackOne',
- },
- { position=>112,
- title => 'TrackTwo',
- }
+ { title => 'TrackOne' },
+ { title => 'TrackTwo' },
],
liner_notes => { notes => 'I can haz liner notes?' },
DBICTest::Schema::Track;
use base 'DBIx::Class::Core';
-__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
+__PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/);
__PACKAGE__->table('track');
__PACKAGE__->add_columns(
__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');