X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FVersionStorage%2FStandard.pm;h=b1af275b395a1f8a6b424886979ad5b611205886;hb=refs%2Fheads%2Fmoo-port;hp=8acb6a8c80348c290375cf1761baa61c01c2f475;hpb=d1ae780e6916bf6637bd6ecc2b349c22487df239;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 8acb6a8..b1af275 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm @@ -1,17 +1,21 @@ package DBIx::Class::DeploymentHandler::VersionStorage::Standard; -use Moose; -use Method::Signatures::Simple; +use Moo; +use DBIx::Class::DeploymentHandler::LogImporter ':log'; +use DBIx::Class::DeploymentHandler::Types 'ResultSet'; + +# ABSTRACT: Version storage that does the normal stuff + +use DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult; has schema => ( - isa => 'DBIx::Class::Schema', is => 'ro', required => 1, ); has version_rs => ( - isa => 'DBIx::Class::ResultSet', + isa => ResultSet, is => 'ro', - lazy_build => 1, + builder => '_build_version_rs', handles => [qw( database_version version_storage_is_installed )], ); @@ -25,16 +29,26 @@ 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; - 1; +# vim: ts=2 sw=2 expandtab + __END__ -vim: ts=2 sw=2 expandtab +=head1 SEE ALSO + +This class is an implementation of +L. Pretty much all the +documentation is there.