X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FVersionStorage%2FDeprecated.pm;h=31471a8cc7c54d77daa8b39c91556e1a903b2646;hb=0df68524a051e42f1a7f8606aee56e7c6b70b302;hp=44c7a3d7a55b16d9151cb02da7bd99b536f6aa3d;hpb=3885a58b2ce7c1acbeb4896f82c7a5880eabed7a;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm index 44c7a3d..31471a8 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm @@ -1,5 +1,13 @@ package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated; use Moose; +use Log::Contextual::WarnLogger; +use Log::Contextual ':log', -default_logger => Log::Contextual::WarnLogger->new({ + env_prefix => 'DBICDH' +}); + + +# ABSTRACT: (DEPRECATED) Use this if you are stuck in the past + use Method::Signatures::Simple; has schema => ( @@ -28,19 +36,35 @@ sub _build_version_rs { sub add_database_version { # deprecated doesn't support ddl or upgrade_ddl - $_[0]->version_rs->create({ version => $_[1]->{version} }) + my $version = $_[1]->{version}; + log_debug { "[DBICDH] Adding database version $version" }; + $_[0]->version_rs->create({ version => $version }) } sub delete_database_version { - $_[0]->version_rs->search({ version => $_[1]->{version}})->delete + my $version = $_[1]->{version}; + log_debug { "[DBICDH] Deleting database version $version" }; + $_[0]->version_rs->search({ version => $version})->delete } __PACKAGE__->meta->make_immutable; 1; +# vim: ts=2 sw=2 expandtab + __END__ +=head1 DEPRECATED + +I begrudgingly made this module (and other related modules) to keep porting +from L relatively simple. I will make changes +to ensure that it works with output from L etc, +but I will not add any new features to it. + +Once I hit major version 1 usage of this module will emit a warning. +On version 2 it will be removed entirely. + =head1 THIS SUCKS Here's how to convert from that crufty old Deprecated VersionStorage to a shiny @@ -61,4 +85,3 @@ new Standard VersionStorage: $dh->version_storage->add_database_vesion({ version => $_ }) for @versions; -vim: ts=2 sw=2 expandtab