1 package make_dbictest_db;
6 use dbixcsl_test_dir qw/$tdir/;
8 eval { require DBD::SQLite };
9 my $class = $@ ? 'SQLite2' : 'SQLite';
11 my $fn = "$tdir/dbictest.db";
14 our $dsn = "dbi:$class:dbname=$fn";
15 my $dbh = DBI->connect($dsn);
16 $dbh->do('PRAGMA SYNCHRONOUS = OFF');
20 fooid INTEGER PRIMARY KEY,
21 footext TEXT DEFAULT 'footext',
22 foodt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
25 barid INTEGER PRIMARY KEY,
26 fooref INTEGER REFERENCES foo(fooid)
28 q|INSERT INTO foo (fooid, footext) VALUES (1,'Foo text for number 1')|,
29 q|INSERT INTO foo (fooid, footext) VALUES (2,'Foo record associated with the Bar with barid 3')|,
30 q|INSERT INTO foo (fooid, footext) VALUES (3,'Foo text for number 3')|,
31 q|INSERT INTO foo (fooid, footext) VALUES (4,'Foo text for number 4')|,
32 q|INSERT INTO bar VALUES (1,4)|,
33 q|INSERT INTO bar VALUES (2,3)|,
34 q|INSERT INTO bar VALUES (3,2)|,
35 q|INSERT INTO bar VALUES (4,1)|,