From: Arthur Axel 'fREW' Schmidt Date: Tue, 30 Mar 2010 03:37:48 +0000 (-0500) Subject: initial pod docs X-Git-Tag: v0.001000_01~25 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96ef97e5693ee296b0b1eedf9910101dfb329a5a;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git initial pod docs --- diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 2ff2375..65c57c5 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -282,18 +282,12 @@ sub prepare_install { sub prepare_upgrade { my ($self, $from_version, $to_version, $version_set) = @_; - # for updates prepared automatically (rob's stuff) - # one would want to explicitly set $version_set to - # [$to_version] $self->_prepare_changegrade($from_version, $to_version, $version_set, 'up'); } sub prepare_downgrade { my ($self, $from_version, $to_version, $version_set) = @_; - # for updates prepared automatically (rob's stuff) - # one would want to explicitly set $version_set to - # [$to_version] $self->_prepare_changegrade($from_version, $to_version, $version_set, 'down'); } diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm index edb52e6..4ff7694 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm @@ -14,4 +14,46 @@ requires 'deploy'; __END__ +# should this be renamed prepare_deploy? + +=method prepare_install + + $deploy_method->prepare_install; + +=method deploy + + $deploy_method->deploy; + +=method prepare_resultsource_install + + $deploy_method->prepare_resultsource_install($resultset->result_source); + +=method install_resultsource + + $deploy_method->prepare_resultsource_install($resultset->result_source); + +# for updates prepared automatically (rob's stuff) +# one would want to explicitly set $version_set to +# [$to_version] + +=method prepare_upgrade + + $deploy_method->prepare_upgrade(1, 2, [1, 2]); + +# for updates prepared automatically (rob's stuff) +# one would want to explicitly set $version_set to +# [$to_version] + +=method prepare_downgrade + + $deploy_method->prepare_downgrade(2, 1, [1, 2]); + +=method upgrade_single_step + + $deploy_method->upgrade_single_step([1, 2]); + +=method downgrade_single_step + + $deploy_method->upgrade_single_step([1, 2]); + vim: ts=2 sw=2 expandtab diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm b/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm index 8f535b4..9881817 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm @@ -10,4 +10,26 @@ requires 'version_storage_is_installed'; __END__ +=method database_version + + my $db_version = $version_storage->database_version; + +=method add_database_version + + $version_storage->add_database_version({ + version => '1.2002', + ddl => $ddl, # optional + upgrade_sql => undef, # optional + }) + +=method delete_database_version + + $version_storage->delete_database_version({ version => '1.2002' }) + +=method version_storage_is_installed + + if ($verson_storage->version_storage_is_installed) { + say q(you're golden!) + } + vim: ts=2 sw=2 expandtab diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm b/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm index c3d15dd..495c8bb 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm @@ -9,6 +9,18 @@ requires 'previous_version_set'; __END__ +=method next_version_set + + while (my $version_set = $versions->next_version_set) { + ... + } + +=method previous_version_set + + while (my $version_set = $versions->previous_version_set) { + ... + } + # normally a VersionHandler will take # a to_version and yeild an iterator of # "version sets" or something like that.