X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FVersionStorage%2FStandard.pm;h=a428534eb968962ef40b76e083a6b282dc1d3f05;hb=fe048ee301e219d737307f2b30e3bd88a7128df6;hp=3da6506e5b616e806252aa06139d80aafedeeeba;hpb=9deabd1fcf64a04422d1903f8656ac445e73336a;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm index 3da6506..a428534 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm @@ -1,12 +1,16 @@ package DBIx::Class::DeploymentHandler::VersionStorage::Standard; use Moose; +use DBIx::Class::DeploymentHandler::Logger; +use Log::Contextual ':log', -package_logger => + DBIx::Class::DeploymentHandler::Logger->new({ + env_prefix => 'DBICDH' + }); # ABSTRACT: Version storage that does the normal stuff -use Method::Signatures::Simple; +use DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult; has schema => ( - isa => 'DBIx::Class::Schema', is => 'ro', required => 1, ); @@ -14,7 +18,7 @@ has schema => ( has version_rs => ( isa => 'DBIx::Class::ResultSet', is => 'ro', - lazy_build => 1, + builder => '_build_version_rs', handles => [qw( database_version version_storage_is_installed )], ); @@ -28,10 +32,16 @@ sub _build_version_rs { $_[0]->schema->resultset('__VERSION') } -sub add_database_version { $_[0]->version_rs->create($_[1]) } +sub add_database_version { + my $version = $_[1]->{version}; + log_debug { "Adding database version $version" }; + $_[0]->version_rs->create($_[1]) +} sub delete_database_version { - $_[0]->version_rs->search({ version => $_[1]->{version}})->delete + my $version = $_[1]->{version}; + log_debug { "Deleting database version $version" }; + $_[0]->version_rs->search({ version => $version})->delete } __PACKAGE__->meta->make_immutable; @@ -42,3 +52,8 @@ __PACKAGE__->meta->make_immutable; __END__ +=head1 SEE ALSO + +This class is an implementation of +L. Pretty much all the +documentation is there.