8 my $schema = DBICTest->init_schema( no_populate => 1 );
10 my $t11 = $schema->resultset('Track')->find_or_create({
12 title => 'Track one cd one',
16 very_long_artist_relationship => {
22 my $t12 = $schema->resultset('Track')->find_or_create({
24 title => 'Track two cd one',
27 very_long_artist_relationship => {
33 # FIXME - MC should be smart enough to infer this on its own...
34 $schema->resultset('Artist')->create({ name => 'Artist two' });
36 my $t2 = $schema->resultset('Track')->find_or_create({
38 title => 'Track one cd one',
42 very_long_artist_relationship => {
49 $schema->resultset('Artist')->search({}, {
50 prefetch => { cds => 'tracks' },
51 order_by => 'tracks.title',
54 { artistid => 1, charfield => undef, name => "Artist one", rank => 13, cds => [
55 { artist => 1, cdid => 1, genreid => undef, single_track => undef, title => "CD one", year => 1, tracks => [
56 { cd => 1, last_updated_at => undef, last_updated_on => undef, position => 1, title => "Track one cd one", trackid => 1 },
57 { cd => 1, last_updated_at => undef, last_updated_on => undef, position => 2, title => "Track two cd one", trackid => 2 },
60 { artistid => 2, charfield => undef, name => "Artist two", rank => 13, cds => [
61 { artist => 2, cdid => 2, genreid => undef, single_track => undef, title => "CD one", year => 1, tracks => [
62 { cd => 2, last_updated_at => undef, last_updated_on => undef, position => 1, title => "Track one cd one", trackid => 3 },
66 'Expected state of database after several find_or_create rounds'