7 use DBIx::Class::_Util 'parent_dir';
9 my $db_fn = parent_dir( $INC{'MyApp/Schema.pm'} ) . '../db/example.db';
11 my $schema = MyApp::Schema->connect("dbi:SQLite:$db_fn");
13 my @artists = (['Michael Jackson'], ['Eminem']);
14 $schema->populate('Artist', [
20 'Thriller' => 'Michael Jackson',
21 'Bad' => 'Michael Jackson',
22 'The Marshall Mathers LP' => 'Eminem',
26 foreach my $lp (keys %albums) {
27 my $artist = $schema->resultset('Artist')->find({
30 push @cds, [$lp, $artist->id];
33 $schema->populate('Cd', [
40 'Beat It' => 'Thriller',
41 'Billie Jean' => 'Thriller',
42 'Dirty Diana' => 'Bad',
43 'Smooth Criminal' => 'Bad',
44 'Leave Me Alone' => 'Bad',
45 'Stan' => 'The Marshall Mathers LP',
46 'The Way I Am' => 'The Marshall Mathers LP',
50 foreach my $track (keys %tracks) {
51 my $cd = $schema->resultset('Cd')->find({
52 title => $tracks{$track},
54 push @tracks, [$cd->id, $track];
57 $schema->populate('Track',[