Remove isa check on schema attributes
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionStorage / Deprecated.pm
index 6bce014..2e0a9f6 100644 (file)
@@ -1,12 +1,15 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated;
 use Moose;
+use DBIx::Class::DeploymentHandler::Logger;
+use Log::Contextual ':log', -package_logger =>
+  DBIx::Class::DeploymentHandler::Logger->new({
+    env_prefix => 'DBICDH'
+  });
 
-# ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
 
-use Method::Signatures::Simple;
+# ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
 
 has schema => (
-  isa      => 'DBIx::Class::Schema',
   is       => 'ro',
   required => 1,
 );
@@ -31,11 +34,15 @@ 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 { "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 { "Deleting database version $version" };
+  $_[0]->version_rs->search({ version => $version})->delete
 }
 
 __PACKAGE__->meta->make_immutable;
@@ -76,3 +83,8 @@ new Standard VersionStorage:
  $dh->version_storage->add_database_vesion({ version => $_ })
    for @versions;
 
+=head1 SEE ALSO
+
+This class is an implementation of
+L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>.  Pretty much all the
+documentation is there.