X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler.pm;h=c22b6ab3df6cbcc17b527de6df84659e0d32fdcc;hb=e217d19c58c8beba917e751dd1089281fa1a74ee;hp=66e62597befb838423ccee269317b7166aff05c8;hpb=a912450b8ca3f98fa8ef136ec40c77817e6cf4c9;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler.pm b/lib/DBIx/Class/DeploymentHandler.pm index 66e6259..c22b6ab 100644 --- a/lib/DBIx/Class/DeploymentHandler.pm +++ b/lib/DBIx/Class/DeploymentHandler.pm @@ -24,7 +24,6 @@ has schema => ( isa => 'DBIx::Class::Schema', is => 'ro', required => 1, - handles => [qw( ddl_filename schema_version )], ); has upgrade_directory => ( # configuration @@ -49,13 +48,15 @@ has do_backup => ( # configuration has version_rs => ( isa => 'DBIx::Class::ResultSet', is => 'ro', - lazy_build => 1, - handles => [qw( is_installed db_version )], + lazy_build => 1, # builder comes from another role... + # which is... probably not how we want it + handles => [qw( is_installed )], ); -has to_version => ( +has to_version => ( # configuration is => 'ro', - lazy_build => 1, + lazy_build => 1, # builder comes from another role... + # which is... probably not how we want it ); has databases => ( # configuration @@ -78,7 +79,7 @@ method install { my $new_version = $self->to_version; if ($new_version) { - $self->deploy; + $self->_deploy; $self->version_rs->create({ version => $new_version, @@ -88,12 +89,14 @@ method install { } } -method upgrade { - while ( my $version_list = $self->next_version_set ) { - $self->upgrade_single_step($version_list); +sub upgrade { + while ( my $version_list = $_[0]->next_version_set ) { + $_[0]->_upgrade_single_step($version_list); } } +method backup { $self->storage->backup($self->backup_directory) } + __PACKAGE__->meta->make_immutable; 1;