8 my $schema = MyApp::Schema->connect('dbi:SQLite:db/example.db');
10 my @artists = (['Michael Jackson'], ['Eminem']);
11 $schema->populate('Artist', [
17 'Thriller' => 'Michael Jackson',
18 'Bad' => 'Michael Jackson',
19 'The Marshall Mathers LP' => 'Eminem',
23 foreach my $lp (keys %albums) {
24 my $artist = $schema->resultset('Artist')->find({
27 push @cds, [$lp, $artist->id];
30 $schema->populate('Cd', [
37 'Beat It' => 'Thriller',
38 'Billie Jean' => 'Thriller',
39 'Dirty Diana' => 'Bad',
40 'Smooth Criminal' => 'Bad',
41 'Leave Me Alone' => 'Bad',
42 'Stan' => 'The Marshall Mathers LP',
43 'The Way I Am' => 'The Marshall Mathers LP',
47 foreach my $track (keys %tracks) {
48 my $cd = $schema->resultset('Cd')->find({
49 title => $tracks{$track},
51 push @tracks, [$cd->id, $track];
54 $schema->populate('Track',[