Examples and documentation update and cleanup
[dbsrgits/DBIx-Class.git] / examples / Schema / insertdb.pl
index 57cf5a1..ae919b3 100755 (executable)
@@ -5,7 +5,10 @@ use warnings;
 
 use MyApp::Schema;
 
-my $schema = MyApp::Schema->connect('dbi:SQLite:db/example.db');
+use Path::Class 'file';
+my $db_fn = file($INC{'MyApp/Schema.pm'})->dir->parent->file('db/example.db');
+
+my $schema = MyApp::Schema->connect("dbi:SQLite:$db_fn");
 
 my @artists = (['Michael Jackson'], ['Eminem']);
 $schema->populate('Artist', [
@@ -28,7 +31,7 @@ foreach my $lp (keys %albums) {
 }
 
 $schema->populate('Cd', [
-    [qw/title artist/],
+    [qw/title artistid/],
     @cds,
 ]);
 
@@ -52,6 +55,6 @@ foreach my $track (keys %tracks) {
 }
 
 $schema->populate('Track',[
-    [qw/cd title/],
+    [qw/cdid title/],
     @tracks,
 ]);