Move relationships out of Relationships.pm and in to the respective classes. Removed...
[dbsrgits/DBIx-Class-Historic.git] / t / lib / DBICTest.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest;
1c339d71 3
4use strict;
5use warnings;
6use DBICTest::Schema;
4b8dcc58 7use DBICTest::Schema::Relationships;
1c339d71 8
4b8dcc58 9sub init_schema {
1c339d71 10 my $db_file = "t/var/DBIxClass.db";
4b8dcc58 11
1c339d71 12 unlink($db_file) if -e $db_file;
13 unlink($db_file . "-journal") if -e $db_file . "-journal";
14 mkdir("t/var") unless -d "t/var";
4b8dcc58 15
e673f011 16 my $dsn = $ENV{"DBICTEST_DSN"} || "dbi:SQLite:${db_file}";
17 my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
18 my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
19
4b8dcc58 20 my $schema = DBICTest::Schema->compose_connection('DBICTest' => $dsn, $dbuser, $dbpass);
21 $schema->deploy();
22 $schema->auto_populate();
23 return $schema;
1c339d71 24}
4b8dcc58 25
510ca912 261;