[Dbix-class] Cookbok receipe for deploy doesn't work for me
Goetz Bock
bock+dbixc at blacknet.de
Sat Mar 17 17:00:56 GMT 2007
On Thu, Mar 15 '07 at 22:38, Matija Grabnar wrote:
> [ ... sqlt / SQL::Translator does not work for me ... ]
Been there, failed there and unable to send mails to the ml...
On IRC I was told to use $schema->deploy or
$schema->storage->deploy_statement. From my 01deploy.t:
-----------------------------------------------------------------------
my $db_file = "test.db";
unlink($db_file) if -e $db_file;
unlink($db_file . "-journal") if -e $db_file . "-journal";
my $dsn = $ENV{"DWA_DSN"} || "dbi:SQLite:${db_file}";
my $dbuser = $ENV{"DWA_DBUSER"} || '';
my $dbpass = $ENV{"DWA_DBPASS"} || '';
my $schema
= MyCom::DB::MyApp::Schema->connection( $dsn, $dbuser, $dbpass );
eval{ $schema->deploy() };
ok( !$@, "Deploy ok." );
-----------------------------------------------------------------------
BTW: Do _not_ test the return code of deploy(), just don't ;-)
--
/"\ Goetz Bock at blacknet dot de -- secure mobile Linux everNETting
\ / (c) 2006 Creative Commons, Attribution-ShareAlike 2.0 de
X [ 1. Use descriptive subjects - 2. Edit a reply for brevity - ]
/ \ [ 3. Reply to the list - 4. Read the archive *before* you post ]
More information about the Dbix-class
mailing list