Permalink
Browse files

Call _run_ddl with a file name, not a string of DDL

  • Loading branch information...
1 parent 04069a7 commit 2945eec28c2e331294c3fbc991122d93caf0d636 @autarch autarch committed Apr 1, 2013
Showing with 2 additions and 9 deletions.
  1. +2 −9 lib/Database/Migrator/Core.pm
@@ -7,8 +7,6 @@ use namespace::autoclean;
use Database::Migrator::Types qw( ArrayRef Bool Dir File Maybe Str );
use DBI;
use Eval::Closure qw( eval_closure );
-use File::Slurp qw( read_file );
-use IPC::Run3 qw( run3 );
use Log::Dispatch;
use Moose::Util::TypeConstraints qw( duck_type );
@@ -140,9 +138,7 @@ sub create_or_update_database {
}
else {
$self->_create_database();
-
- my $schema_ddl = read_file( $self->schema_file()->stringify() );
- $self->_run_ddl($schema_ddl);
+ $self->_run_ddl( $self->schema_file() );
}
$self->_run_migrations();
@@ -170,10 +166,7 @@ sub _run_one_migration {
my $basename = $file->basename();
if ( $file =~ /\.sql/ ) {
$self->logger()->debug(" - running $basename as sql");
-
- my $migration_ddl = read_file( $file->stringify() );
-
- $self->_run_ddl($migration_ddl);
+ $self->_run_ddl($file);
}
else {
$self->logger()->debug(" - running $basename as perl code");

0 comments on commit 2945eec

Please sign in to comment.