Subject: | problems with code in tutorial |
Date: | Thu, 15 Mar 2012 21:17:59 +0000 |
To: | bug-DBIx-Class-Migration [...] rt.cpan.org |
From: | Frank Schwach <fs5 [...] sanger.ac.uk> |
installed version of DBIx::Class::Migration: 0.017
perl version 5.8.8
I'm following along with your tutorial and found the following problem:
in DBIx::Class::Migration::Tutorial::FirstMigration
the command
dbic-migration version --schema_class MusicBase::Schema -Ilib
doesn't work. Error output:
Attribute (dsn) does not pass the type constraint because: Validation
failed for 'Str' with value undef at constructor
DBIx::Class::Migration::Script::new (defined at
/software/team131/lib/perl5/DBIx/Class/Migration/Script.pm line 201) line 66
DBIx::Class::Migration::Script::new('DBIx::Class::Migration::Script',
'ARGV', 'ARRAY(0x156a060)', 'extra_argv', 'ARRAY(0x19921c0)', 'usage',
'Getopt::Long::Descriptive::Usage=HASH(0x1783970)', 'schema_class',
'MusicBase::Schema', 'includes', 'ARRAY(0x156a000)') called at
/software/team131/lib/perl5/MooseX/Getopt/Basic.pm line 96
MooseX::Getopt::Basic::new_with_options('DBIx::Class::Migration::Script') called
at /software/team131/lib/perl5/DBIx/Class/Migration/Script.pm line 192
DBIx::Class::Migration::Script::run_with_options('DBIx::Class::Migration::Script')
called at /software/team131/bin/dbic-migration line 4
You have to supply some string value for --dsn to get the output you
gave in the tutotial.
Likewise, I had to supply a dsn to connect to a local sqlite db and get
the status and set up the db like this:
dbic-migration --schema_class MusicBase::Schema -Ilib --dsn
"dbi:SQLite:dbname=share/musicbase-schema.db" status
without that, the same error (undefined dsn) was thrown.
Thanks for looking into this and thanks for providing this module!
Frank
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.