8 my $schema = MyDatabase::Main->connect('dbi:SQLite:db/example.db');
10 # here's some of the sql that is going to be generated by the schema
11 # INSERT INTO artist VALUES (NULL,'Michael Jackson');
12 # INSERT INTO artist VALUES (NULL,'Eminem');
14 my @artists = (['Michael Jackson'], ['Eminem']);
15 $schema->populate('Artist', [
21 'Thriller' => 'Michael Jackson',
22 'Bad' => 'Michael Jackson',
23 'The Marshall Mathers LP' => 'Eminem',
27 foreach my $lp (keys %albums) {
28 my $artist = $schema->resultset('Artist')->find({
31 push @cds, [$lp, $artist->id];
34 $schema->populate('Cd', [
41 'Beat It' => 'Thriller',
42 'Billie Jean' => 'Thriller',
43 'Dirty Diana' => 'Bad',
44 'Smooth Criminal' => 'Bad',
45 'Leave Me Alone' => 'Bad',
46 'Stan' => 'The Marshall Mathers LP',
47 'The Way I Am' => 'The Marshall Mathers LP',
51 foreach my $track (keys %tracks) {
52 my $cd = $schema->resultset('Cd')->find({
53 title => $tracks{$track},
55 push @tracks, [$cd->id, $track];
58 $schema->populate('Track',[