X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FHandlesDeploy.pm;h=14c3256740a1c4b22cb6cd5a0b46bbd9bd0b92d8;hb=c72832d7e13479886dbe0d3cfd1f444a8404523f;hp=089eda12473111182e480852fce21ddaff5c4312;hpb=80ff6f6de5995403431369d67fc2e441c134a4b4;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm index 089eda1..14c3256 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm @@ -3,7 +3,7 @@ use Moose::Role; # ABSTRACT: Interface for deploy methods -requires 'preinstall'; +requires 'initialize'; requires 'prepare_deploy'; requires 'deploy'; @@ -23,9 +23,12 @@ requires 'downgrade_single_step'; __END__ -=method preinstall +=method initialize - $dh->preinstall + $dh->initialize({ + version => 1, + storage_type => 'SQLite' + }); Run scripts before deploying to the database @@ -37,27 +40,36 @@ Generate the needed data files to install the schema to the database. =method deploy - $dh->deploy + $dh->deploy({ version => 1 }) Deploy the schema to the database. =method prepare_resultsource_install - $dh->prepare_resultsource_install($resultset->result_source) + $dh->prepare_resultsource_install({ + result_source => $resultset->result_source, + }) Takes a L and generates a single migration file to create the resultsource's table. =method install_resultsource - $dh->prepare_resultsource_install($resultset->result_source); + $dh->install_resultsource({ + result_source => $resultset->result_source, + version => 1, + }) Takes a L and runs a single migration file to deploy the resultsource's table. =method prepare_upgrade - $dh->prepare_upgrade(1, 2, [1, 2]); + $dh->prepare_upgrade({ + from_version => 1, + to_version => 2, + version_set => [1, 2] + }); Takes two versions and a version set. This basically is supposed to generate the needed C to migrate up from the first version to the second version. @@ -65,7 +77,11 @@ The version set uniquely identifies the migration. =method prepare_downgrade - $dh->prepare_downgrade(2, 1, [1, 2]); + $dh->prepare_downgrade({ + from_version => 1, + to_version => 2, + version_set => [1, 2] + }); 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. @@ -74,7 +90,9 @@ respective upgrade version set. =method upgrade_single_step - my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]} + my ($ddl, $sql) = @{ + $dh->upgrade_single_step({ version_set => $version_set }) + ||[]} Call a single upgrade migration. Takes a version set as an argument. Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for