[Dbix-class] User error? SQLite problem? with DBIx::Class::Fixtures
and populate
Ashley
apv at sedition.com
Tue Oct 7 18:22:55 BST 2008
I'm messing around with writing some tests with DBIx::Class::Fixtures
and getting stuck. Trying to see if it's something obvious I'm doing
wrong or there is currently an sqlite problem. The code below runs
fine except the final step: $fixtures->populate. This is the error it
gives-
SQL was:
DROP TABLE account
DBIx::Class::Fixtures::populate(): DBI Exception: DBD::SQLite::db do
failed: no such table: account(1) at dbdimp.c line 271 [for Statement
"DROP TABLE account"] at ./fixture-test.pl line 40
1..2
There is a table "account" and it's in the MyApp-Test-Schema-1-
SQLite.sql as well as the dumped $schema object. My DBIC modules are
all current.
Any ideas?
-Ashley
--
require_ok("MyApp::Test::Schema");
ok( my $schema = MyApp::Test::Schema->connect
('dbi:SQLite:apond_data.db') );
$schema->deploy();
my $fixtures = DBIx::Class::Fixtures->new({ config_dir => './
fixture_config' });
$fixtures->dump({
config => 'first_stab.json',
schema => $schema,
directory => './fixture_config',
});
unlink "./MyApp-Test-Schema-1-SQLite.sql";
$schema->create_ddl_dir(['SQLite'],1);
$fixtures->populate({
directory => './fixture_config',
ddl => './MyApp-Test-Schema-1-SQLite.sql',
connection_details => ['dbi:SQLite:apond_data.db']
});
__DATA__
first_stab.json looks like
{
sets: [{
class: 'Account',
ids: ['7311']
}]
}
More information about the DBIx-Class
mailing list