[Bast-commits] r4391 -
DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class
drew at dev.catalyst.perl.org
drew at dev.catalyst.perl.org
Mon May 19 16:16:58 BST 2008
Author: drew
Date: 2008-05-19 16:16:58 +0100 (Mon, 19 May 2008)
New Revision: 4391
Modified:
DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm
Log:
Move post_ddl processing into separate method
Modified: DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm
===================================================================
--- DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm 2008-05-16 18:17:23 UTC (rev 4390)
+++ DBIx-Class-Fixtures/1.001/trunk/lib/DBIx/Class/Fixtures.pm 2008-05-19 15:16:58 UTC (rev 4391)
@@ -853,14 +853,7 @@
$rs->populate(\@rows);
}
- if ($params->{post_ddl}) {
- my $data = _read_sql($params->{post_ddl});
- foreach (@$data) {
- eval { $schema->storage->dbh->do($_) or warn "SQL was:\n $_"};
- if ($@) { die "SQL was:\n $_\n$@"; }
- }
- $self->msg("- finished importing post-populate DDL into DB");
- }
+ $self->do_post_ddl({schema=>$schema, post_ddl=>$params->{post_ddl}}) if $params->{post_ddl};
$self->msg("- fixtures imported");
$self->msg("- cleaning up");
@@ -870,6 +863,18 @@
return 1;
}
+sub do_post_ddl {
+ my ($self, $params) = @_;
+
+ my $schema = $params->{schema};
+ my $data = _read_sql($params->{post_ddl});
+ foreach (@$data) {
+ eval { $schema->storage->dbh->do($_) or warn "SQL was:\n $_"};
+ if ($@) { die "SQL was:\n $_\n$@"; }
+ }
+ $self->msg("- finished importing post-populate DDL into DB");
+}
+
sub msg {
my $self = shift;
my $subject = shift || return;
More information about the Bast-commits
mailing list