X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FDad.pm;h=f948f21a5dfbf2535dd217d2de7e8082db0bde28;hb=cefb17d43f1405285036ab195ed4fe5e55eae422;hp=8b6b8c4c7255b6a00b0fcbcd863b54cdf345ce01;hpb=e52174e31b95fe335f6ab8cfdbf23cc2a0c05673;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/Dad.pm b/lib/DBIx/Class/DeploymentHandler/Dad.pm index 8b6b8c4..f948f21 100644 --- a/lib/DBIx/Class/DeploymentHandler/Dad.pm +++ b/lib/DBIx/Class/DeploymentHandler/Dad.pm @@ -1,5 +1,7 @@ package DBIx::Class::DeploymentHandler::Dad; +# ABSTRACT: Parent class for DeploymentHandlers + use Moose; use Method::Signatures::Simple; require DBIx::Class::Schema; # loaded for type constraint @@ -9,7 +11,6 @@ has schema => ( isa => 'DBIx::Class::Schema', is => 'ro', required => 1, - handles => ['schema_version'], ); has backup_directory => ( @@ -25,6 +26,13 @@ has to_version => ( sub _build_to_version { $_[0]->schema->schema_version } +has schema_version => ( + is => 'ro', + lazy_build => 1, +); + +sub _build_schema_version { $_[0]->schema->schema_version } + method install { croak 'Install not possible as versions table already exists in database' if $self->version_storage_is_installed; @@ -79,7 +87,7 @@ and generate the DDL. =attr backup_directory -The directory that backups are stored in +The directory where backups are stored =attr to_version @@ -92,7 +100,7 @@ The version (defaults to schema's version) to migrate the database to Deploys the current schema into the database. Populates C with C and C. -B: you typically need to call C<< $dh->prepare_install >> before you call +B: you typically need to call C<< $dh->prepare_deploy >> before you call this method. B: you cannot install on top of an already installed database @@ -167,9 +175,9 @@ should probably implement these too, even if they are no-ops. see L -=head2 prepare_install +=head2 prepare_deploy -see L +see L =head2 prepare_resultsource_install @@ -187,8 +195,6 @@ see L see L -=back - =head2 SUBCLASSING All of the methods mentioned in L and