8 $DUMP_DIR = './t/_common_dump';
12 use DBIx::Class::Schema::Loader 'make_schema_at', "dump_to_dir:$DUMP_DIR";
16 my ($dsn, $user, $password) = map $ENV{"DBICTEST_MYSQL_$_"}, qw/DSN USER PASS/;
18 if( !$dsn || !$user ) {
19 plan skip_all => 'You need to set the DBICTEST_MYSQL_DSN, _USER, and _PASS'
20 .' environment variables';
23 eval "use SQL::Translator '0.09007';";
24 plan skip_all => 'SQL::Translator 0.09007 or greater required'
29 my $dbh = DBI->connect($dsn, $user, $password, {
30 RaiseError => 1, PrintError => 0
33 eval { $dbh->do('DROP TABLE loadertest') };
35 CREATE TABLE loadertest (
37 somedate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
38 somestr VARCHAR(100) NOT NULL DEFAULT 'foo'
41 # XXX there needs to be code to distinguish these two types of defaults
49 constraint => qr/^loadertest\z/
51 [ $dsn, $user, $password, ]
54 lives_ok { require TestSL::Schema } 'schema loads';
56 $dbh->do('DROP TABLE loadertest');
58 my $schema = TestSL::Schema->connect($dsn, $user, $password);
61 local $SIG{__WARN__} = sub { push @warnings, shift };
65 ok (not(grep /Invalid default/, @warnings)), 'default deployed';
66 diag $_ for @warnings;
70 eval { $dbh->do('DROP TABLE loadertest') };