Revision history for {{$dist->name}}
{{$NEXT}}
+ - Add basic tool for showing progress
- Stop warning all the time (ribasushi)
- croak on a couple errors that should be fatal
- Stop deleting the wrong version (for downgrades)
lazy_build => 1,
);
+has progress_callback => (
+ is => 'rw',
+ isa => 'Maybe[CodeRef]',
+);
+
method _build_storage {
my $s = $self->schema->storage;
$s->_determine_driver;
$self->_run_sql_array($sql_to_run) if $self->ignore_ddl;
my $sql = ($sql_to_run)?join ";\n", @$sql_to_run:'';
+ my $i= -1;
FILENAME:
for my $filename (@files) {
+ $i++;
if ($self->ignore_ddl && $filename =~ /^[^_]*-auto.*\.sql$/) {
+ $self->progress_callback and $self->progress_callback->($i, scalar(@files), 'skip', $filename);
next FILENAME
} elsif ($filename =~ /\.sql$/) {
- $sql .= $self->_run_sql($filename)
+ $self->progress_callback and $self->progress_callback->($i, scalar(@files), 'sql', $filename);
+ $sql .= $self->_run_sql($filename)
} elsif ( $filename =~ /\.pl$/ ) {
- $self->_run_perl($filename, $versions)
+ $self->progress_callback and $self->progress_callback->($i, scalar(@files), 'perl', $filename);
+ $self->_run_perl($filename, $versions)
} else {
croak "A file ($filename) got to deploy that wasn't sql or perl!";
}