Messy diagnostic info from failure to clean up cleanly in cleanup().
(in cleanup) Can't call method "name" on an undefined value at
/usr/lib64/perl5/vendor_perl/5.12.4/Test/DBIx/Class/SchemaManager.pm
line 187 during global destruction.
(in cleanup) Can't call method "with_deferred_fk_checks" on an undefined
value at
/usr/lib64/perl5/vendor_perl/5.12.4/Test/DBIx/Class/SchemaManager.pm
line 192 during global destruction.
# minor patch required to fix - attached.
--
http://www.rfi.net
Subject: | SchemaManager.pm.diff |
--- SchemaManager.pm.orig 2011-09-28 14:06:16.490973830 +0200
+++ SchemaManager.pm.fix 2011-09-28 14:07:25.232586347 +0200
@@ -180,11 +180,14 @@
my $schema = $self->schema;
return unless $schema;
+ return unless $schema->storage;
unless ($self->keep_db) {
$schema->storage->with_deferred_fk_checks(sub {
foreach my $source ($schema->sources) {
- my $table = $schema->source($source)->name;
+ my $tablesource = $schema->source($source);
+ next unless $tablesource;
+ my $table = $tablesource->name;
$schema->storage->dbh->do("drop table $table")
if !($schema->source($source)->can('is_virtual') &&
$schema->source($source)->is_virtual);