Move relationships out of Relationships.pm and in to the respective classes. Removed...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest.pm
1 package # hide from PAUSE 
2     DBICTest;
3
4 use strict;
5 use warnings;
6 use DBICTest::Schema;
7 use DBICTest::Schema::Relationships;
8
9 sub init_schema {
10   my $db_file = "t/var/DBIxClass.db";
11
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";
15
16   my $dsn = $ENV{"DBICTEST_DSN"} || "dbi:SQLite:${db_file}";
17   my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
18   my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
19
20   my $schema = DBICTest::Schema->compose_connection('DBICTest' => $dsn, $dbuser, $dbpass);
21   $schema->deploy();
22   $schema->auto_populate();
23   return $schema;
24 }
25
26 1;