From: Arthur Axel 'fREW' Schmidt Date: Tue, 27 Apr 2010 17:58:46 +0000 (-0500) Subject: use a builder for schema_version so the user can specify it if need be X-Git-Tag: v0.001000_04~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-DeploymentHandler.git;a=commitdiff_plain;h=cefb17d43f1405285036ab195ed4fe5e55eae422 use a builder for schema_version so the user can specify it if need be --- diff --git a/lib/DBIx/Class/DeploymentHandler/Dad.pm b/lib/DBIx/Class/DeploymentHandler/Dad.pm index 85757a9..f948f21 100644 --- a/lib/DBIx/Class/DeploymentHandler/Dad.pm +++ b/lib/DBIx/Class/DeploymentHandler/Dad.pm @@ -11,7 +11,6 @@ has schema => ( isa => 'DBIx::Class::Schema', is => 'ro', required => 1, - handles => ['schema_version'], ); has backup_directory => ( @@ -27,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;