Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implement _build_database_exists by trying to build a database handle

  • Loading branch information...
commit 9c69e28290aa1e756eb5fdae21035c2d61e11bab 1 parent ee11ffb
@autarch authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Database/Migrator/Core.pm
View
8 lib/Database/Migrator/Core.pm
@@ -15,7 +15,6 @@ use Moose::Role;
with 'MooseX::Getopt::Dashes';
requires qw(
- _build_database_exists
_create_database
_drop_database
_run_ddl
@@ -227,6 +226,13 @@ sub _build_logger {
return Log::Dispatch->new( outputs => [$outputs] );
}
+sub _build_database_exists {
+ my $self = shift;
+
+ local $@;
+ return eval { $self->_build_dbh() } ? 1 : 0;
+}
+
sub _build_dbh {
my $self = shift;
Please sign in to comment.
Something went wrong with that request. Please try again.