add missing newline for no-linenumber-change dzil
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionStorage / Standard.pm
index 9617023..2e699ba 100644 (file)
@@ -1,9 +1,13 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Standard;
+
 use Moose;
-use Method::Signatures::Simple;
+use DBIx::Class::DeploymentHandler::LogImporter ':log';
+
+# 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,
 );
@@ -11,7 +15,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 )],
 );
 
@@ -25,31 +29,28 @@ 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;
 
-__END__
-
-=head1 THIS SUCKS
-
-You started your project and weren't using DBICDH?  FOOL!  Lucky for you I had
-you in mind when I wrote this doc <3
-
-First off, you'll want to just install the version_storage:
+# vim: ts=2 sw=2 expandtab
 
- my $s = My::Schema->connect(...);
- my $dh = DeployHandler({ schema => $s });
-
- $dh->prepare_version_storage_install;
- $dh->install_version_storage;
+__END__
 
-Then, bump your schema version, and you can use DBICDH like normal!
+=head1 SEE ALSO
 
-vim: ts=2 sw=2 expandtab
+This class is an implementation of
+L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>.  Pretty much all the
+documentation is there.