$self->_use ($table_class, @{$self->additional_classes});
$self->_inject($table_class, @{$self->additional_base_classes});
- $self->_dbic_stmt($table_class, 'load_components', @{$self->components}, qw/PK::Auto Core/);
+ $self->_dbic_stmt($table_class, 'load_components', @{$self->components}, 'Core');
$self->_dbic_stmt($table_class, 'load_resultset_components', @{$self->resultset_components})
if @{$self->resultset_components};
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
'DBICTest::Schema::7',
- { relationships => 1 },
+ { dump_overwrite => 1 },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::7->clone;
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->connect(
$make_dbictest_db::dsn,
- { loader_options => { relationships => 1 } }
+ { loader_options => { dump_overwrite => 1 } }
);
},
'embedded_options_in_attrs' => sub {
$make_dbictest_db::dsn,
undef,
undef,
- { AutoCommit => 1, loader_options => { relationships => 1 } }
+ { AutoCommit => 1, loader_options => { dump_overwrite => 1 } }
);
},
'embedded_options_make_schema_at' => sub {
{ },
[
$make_dbictest_db::dsn,
- { loader_options => { relationships => 1 } },
+ { loader_options => { dump_overwrite => 1 } },
],
);
"DBICTest::Schema::10";
'almost_embedded' => sub {
package DBICTest::Schema::11;
use base qw/ DBIx::Class::Schema::Loader /;
- __PACKAGE__->loader_options( relationships => 1 );
+ __PACKAGE__->loader_options( dump_overwrite => 1 );
__PACKAGE__->connect(
$make_dbictest_db::dsn,
undef, undef, { AutoCommit => 1 }
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
'DBICTest::Schema::12',
- { relationships => 1 },
+ { dump_overwrite => 1 },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::12->clone;
package DBICTest::Schema;
use base qw/ DBIx::Class::Schema::Loader /;
- __PACKAGE__->loader_options( relationships => 1 );
+ __PACKAGE__->loader_options( dump_overwrite => 1 );
__PACKAGE__->storage_type( '::xyzzy' );
}
package DBICTest::Schema::1;
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->loader_options(
- relationships => 1,
dump_directory => $dump_path,
);
}
package DBICTest::Schema::2;
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->loader_options(
- relationships => 1,
dump_directory => $dump_path,
dump_overwrite => 1,
);
--- /dev/null
+use strict;
+use Test::More;
+use lib qw(t/lib);
+use File::Path;
+use make_dbictest_db;
+require DBIx::Class::Schema::Loader;
+
+plan tests => 5;
+
+plan skip_all => "ActiveState perl produces additional warnings"
+ if ($^O eq 'MSWin32');
+
+my $dump_path = './t/_dump';
+
+sub do_dump_test {
+ my ($schema_class, $opts) = @_;
+
+ rmtree($dump_path, 1, 1);
+
+ no strict 'refs';
+ @{$schema_class . '::ISA'} = ('DBIx::Class::Schema::Loader');
+ $schema_class->loader_options(dump_directory => $dump_path, %$opts);
+
+ my @warn_output;
+ eval {
+ local $SIG{__WARN__} = sub { push(@warn_output, @_) };
+ $schema_class->connect($make_dbictest_db::dsn);
+ };
+ my $err = $@;
+ $schema_class->storage->disconnect if !$err && $schema_class->storage;
+ undef *{$schema_class};
+ return ($err, \@warn_output);
+}
+
+
+{
+ my ($err, $warn) = do_dump_test('DBICTest::Schema::1', { });
+ ok(!$err);
+ is(@$warn, 2);
+ like($warn->[0], qr/Dumping manual schema for DBICTest::Schema::1 to directory /);
+ like($warn->[1], qr/Schema dump completed/);
+}
+
+ok(1);
+
+# XXX obviously this test file needs to be fleshed out more :)
+
+# END { rmtree($dump_path, 1, 1); }