X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2FSchema%2Finsertdb.pl;h=4fb22fa590b8de3105590e1a9599281bd61103c9;hb=adcc1df0049e0093cb94c867bd2be8c9fe242a61;hp=57cf5a14c997dd3d23deea85e8ddaeb631b481eb;hpb=410a6bced6035333d48c2b92ad968a722a0a0b09;p=dbsrgits%2FDBIx-Class.git diff --git a/examples/Schema/insertdb.pl b/examples/Schema/insertdb.pl index 57cf5a1..4fb22fa 100755 --- a/examples/Schema/insertdb.pl +++ b/examples/Schema/insertdb.pl @@ -4,8 +4,11 @@ use strict; use warnings; use MyApp::Schema; +use DBIx::Class::_Util 'parent_dir'; -my $schema = MyApp::Schema->connect('dbi:SQLite:db/example.db'); +my $db_fn = parent_dir( $INC{'MyApp/Schema.pm'} ) . '../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, ]);