Massive cleanup of DateTime test dependencies, other interim
[dbsrgits/DBIx-Class.git] / t / 746db2_400.t
index 9ebe7cc..29b7ff1 100644 (file)
@@ -1,5 +1,5 @@
 use strict;
-use warnings;  
+use warnings;
 
 use Test::More;
 use lib qw(t/lib);
@@ -21,9 +21,15 @@ my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
 
 my $dbh = $schema->storage->dbh;
 
-$dbh->do("DROP TABLE artist", { RaiseError => 0, PrintError => 0 });
+eval { $dbh->do("DROP TABLE artist") };
 
-$dbh->do("CREATE TABLE artist (artistid INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), name VARCHAR(255), charfield CHAR(10))");
+$dbh->do(<<'');
+CREATE TABLE artist (
+    artistid INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+    name VARCHAR(255),
+    rank INTEGER default 13 not null,
+    charfield CHAR(10)
+)
 
 # Just to test loading, already in Core
 $schema->class('Artist')->load_components('PK::Auto');
@@ -58,6 +64,11 @@ my $test_type_info = {
         'is_nullable' => 1,
         'size' => 255
     },
+    'rank' => {
+        'data_type' => 'INTEGER',
+        'is_nullable' => 0,
+        'size' => 10,
+    },
     'charfield' => {
         'data_type' => 'CHAR',
         'is_nullable' => 1,
@@ -71,6 +82,6 @@ is_deeply($type_info, $test_type_info, 'columns_info_for - column data types');
 
 # clean up our mess
 END {
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do("DROP TABLE artist") if $dbh;
 }
-