X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FHandlesDeploy.pm;h=b020eacccd994357a12f9e5ad0f2c2f1c7af83a6;hb=refs%2Fheads%2Fmoo-port;hp=83702f12fb743f406141531f2bfcfc2a07c83ed4;hpb=be140a5f1f8ab40705bf4cbedb74761c4994a765;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm index 83702f1..b020eac 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm @@ -1,9 +1,9 @@ package DBIx::Class::DeploymentHandler::HandlesDeploy; -use Moose::Role; +use Moo::Role; # ABSTRACT: Interface for deploy methods -requires 'preinstall'; +requires 'initialize'; requires 'prepare_deploy'; requires 'deploy'; @@ -17,15 +17,17 @@ requires 'upgrade_single_step'; requires 'prepare_downgrade'; requires 'downgrade_single_step'; +requires 'txn_do'; + 1; # vim: ts=2 sw=2 expandtab __END__ -=method preinstall +=method initialize - $dh->preinstall({ + $dh->initialize({ version => 1, storage_type => 'SQLite' }); @@ -85,7 +87,7 @@ The version set uniquely identifies the migration. Takes two versions and a version set. This basically is supposed to generate the needed C to migrate down from the first version to the second version. -The version set uniquely identifies the migration and should match it's +The version set uniquely identifies the migration and should match its respective upgrade version set. =method upgrade_single_step @@ -108,6 +110,12 @@ Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for that version of the schema and C<$upgrade_sql> is the SQL that was run to upgrade the database. +=method txn_do + + $dh->txn_do(sub { ... }) + +Wrap the passed coderef in a transaction (if transactions are enabled.) + =head1 KNOWN IMPLEMENTATIONS =over