X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FHandlesDeploy.pm;h=089eda12473111182e480852fce21ddaff5c4312;hb=80ff6f6de5995403431369d67fc2e441c134a4b4;hp=4ff7694a71459f18a3a34ea4eee6516aa418ba88;hpb=96ef97e5693ee296b0b1eedf9910101dfb329a5a;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm index 4ff7694..089eda1 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm @@ -1,59 +1,106 @@ package DBIx::Class::DeploymentHandler::HandlesDeploy; use Moose::Role; -requires 'prepare_install'; +# ABSTRACT: Interface for deploy methods + +requires 'preinstall'; + +requires 'prepare_deploy'; +requires 'deploy'; + requires 'prepare_resultsource_install'; requires 'install_resultsource'; + requires 'prepare_upgrade'; -requires 'prepare_downgrade'; requires 'upgrade_single_step'; + +requires 'prepare_downgrade'; requires 'downgrade_single_step'; -requires 'deploy'; 1; +# vim: ts=2 sw=2 expandtab + __END__ -# should this be renamed prepare_deploy? +=method preinstall + + $dh->preinstall + +Run scripts before deploying to the database + +=method prepare_deploy -=method prepare_install + $dh->prepare_deploy - $deploy_method->prepare_install; +Generate the needed data files to install the schema to the database. =method deploy - $deploy_method->deploy; + $dh->deploy + +Deploy the schema to the database. =method prepare_resultsource_install - $deploy_method->prepare_resultsource_install($resultset->result_source); + $dh->prepare_resultsource_install($resultset->result_source) + +Takes a L and generates a single migration file to +create the resultsource's table. =method install_resultsource - $deploy_method->prepare_resultsource_install($resultset->result_source); + $dh->prepare_resultsource_install($resultset->result_source); -# for updates prepared automatically (rob's stuff) -# one would want to explicitly set $version_set to -# [$to_version] +Takes a L and runs a single migration file to +deploy the resultsource's table. =method prepare_upgrade - $deploy_method->prepare_upgrade(1, 2, [1, 2]); + $dh->prepare_upgrade(1, 2, [1, 2]); -# for updates prepared automatically (rob's stuff) -# one would want to explicitly set $version_set to -# [$to_version] +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. +The version set uniquely identifies the migration. =method prepare_downgrade - $deploy_method->prepare_downgrade(2, 1, [1, 2]); + $dh->prepare_downgrade(2, 1, [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. +The version set uniquely identifies the migration and should match it's +respective upgrade version set. =method upgrade_single_step - $deploy_method->upgrade_single_step([1, 2]); + my ($ddl, $sql) = @{$dh->upgrade_single_step($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 +that version of the schema and C<$upgrade_sql> is the SQL that was run to +upgrade the database. =method downgrade_single_step - $deploy_method->upgrade_single_step([1, 2]); + $dh->downgrade_single_step($version_set); + +Call a single downgrade migration. Takes a version set as an argument. +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. + +=head1 KNOWN IMPLEMENTATIONS + +=over + +=item * + +L + +=item * + +L + +=back -vim: ts=2 sw=2 expandtab