X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fmake_dbictest_db.pm;h=d87dd01f2e6d1746cfec54e3b0f752caf6498b17;hb=836c85195952fb4ea802595a60597a7f5599a528;hp=a796ba9d02c11c2020e5215dc235a0275806107c;hpb=996be9ee6e82ec9928f801ecdc69c9e07d64339c;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/lib/make_dbictest_db.pm b/t/lib/make_dbictest_db.pm index a796ba9..d87dd01 100644 --- a/t/lib/make_dbictest_db.pm +++ b/t/lib/make_dbictest_db.pm @@ -3,29 +3,32 @@ package make_dbictest_db; use strict; use warnings; use DBI; +use dbixcsl_test_dir qw/$tdir/; eval { require DBD::SQLite }; my $class = $@ ? 'SQLite2' : 'SQLite'; -my $fn = './t/dbictest.db'; +my $fn = "$tdir/dbictest.db"; unlink($fn); - -my $dbh = DBI->connect("dbi:$class:dbname=./t/dbictest.db"); +our $dsn = "dbi:$class:dbname=$fn"; +my $dbh = DBI->connect($dsn); +$dbh->do('PRAGMA SYNCHRONOUS = OFF'); $dbh->do($_) for ( q|CREATE TABLE foo ( fooid INTEGER PRIMARY KEY, - footext TEXT + footext TEXT DEFAULT 'footext', + foodt TIMESTAMP DEFAULT CURRENT_TIMESTAMP )|, q|CREATE TABLE bar ( barid INTEGER PRIMARY KEY, fooref INTEGER REFERENCES foo(fooid) )|, - q|INSERT INTO foo VALUES (1,'Foo text for number 1')|, - q|INSERT INTO foo VALUES (2,'This is the text of the only Foo record associated with the Bar with barid 3')|, - q|INSERT INTO foo VALUES (3,'Foo text for number 3')|, - q|INSERT INTO foo VALUES (4,'Foo text for number 4')|, + q|INSERT INTO foo (fooid, footext) VALUES (1,'Foo text for number 1')|, + q|INSERT INTO foo (fooid, footext) VALUES (2,'Foo record associated with the Bar with barid 3')|, + q|INSERT INTO foo (fooid, footext) VALUES (3,'Foo text for number 3')|, + q|INSERT INTO foo (fooid, footext) VALUES (4,'Foo text for number 4')|, q|INSERT INTO bar VALUES (1,4)|, q|INSERT INTO bar VALUES (2,3)|, q|INSERT INTO bar VALUES (3,2)|,