[Dbix-class] deploymenthandler and version storage (0.001002)

Seth Daniel dbix-class at sethdaniel.org
Thu Jul 8 18:53:49 GMT 2010


Hello,

I have been looking at using DBIXC::DeploymentHandler.  I'm wondering if
the following is a bug.

Use the code that is mentioned in the perldoc for DBIC::DeploymentHandler
for creating the version storage table:

  1: my $s = <connect to db>
  2: 
  3: my $dh = DBIx::Class::DeploymentHandler->new( { schema => $s } );
  4: $dh->prepare_version_storage_install;
  5: $dh->install_version_storage;
  6:
  7: $dh->add_database_version( { version => $s->schema_version } );


Line 4 creates a file structure that looks like:

  sql/MySQL/deploy/<version>/001-auto-__VERSION.sql

Line 5 attempts to load the sql file from above, but it drops the
version number from the path, so it fails with the following error:

  Can't open 'sql/MySQL/deploy/001-auto-__VERSION.sql' for reading: 'No such file or directory' at /opt/perl/5.10/lib/site_perl/5.10.1/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm line 575


It looks like 'install_resultsource' in
DBIXC::DeploymentHandler::DeployMethod::Sql::Translator is expecting a
version key in the passed in hash, but this key is not passed in when
'install_version_storage' is called.  When I hacked passing in a version
the code worked as I expected it to.

-- 
seth /\ sethdaniel.org



More information about the DBIx-Class mailing list