test case for large pks and handle more pg date like types
John Napiorkowski [Thu, 13 Sep 2012 15:52:13 +0000 (11:52 -0400)]
Changes
lib/DBIx/Class/Fixtures.pm
t/04-dump-fetch.t
t/lib/DBICTest.pm
t/var/configs/fetch.json

diff --git a/Changes b/Changes
index 0084543..a73508a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for DBIx-Class-Fixtures
 
+1.001016
+- Support more Pg types for datetime_relative (added TIME, DATE, INTERVAL,
+  TIMESTAMP)
+- experimental support for PG SERIAL columns and sequences.
+
 1.001015
 - ::External::File makes the path if its missing
 
index c4d30fa..4b1f137 100644 (file)
@@ -892,7 +892,13 @@ sub dump_object {
 
           next unless $value
             && $col_info->{_inflate_info}
-              && uc($col_info->{data_type}) eq 'DATETIME';
+              && (
+                  (uc($col_info->{data_type}) eq 'DATETIME')
+                    or (uc($col_info->{data_type}) eq 'DATE')
+                    or (uc($col_info->{data_type}) eq 'TIME')
+                    or (uc($col_info->{data_type}) eq 'TIMESTAMP')
+                    or (uc($col_info->{data_type}) eq 'INTERVAL')
+                 );
 
           $ds{$col} = $object->get_inflated_column($col)->subtract_datetime($dt);
         }
index ad7bfda..e1e9a24 100644 (file)
@@ -19,7 +19,7 @@ ok($fixtures->dump({ config => 'fetch.json', schema => $schema, directory => 't/
 # check dump is okay
 my $dir = dir('t/var/fixtures/artist');
 my @children = $dir->children;
-is(scalar(@children), 2, 'right number of artist fixtures created');
+is(scalar(@children), 3, 'right number of artist fixtures created');
 
 # check both artists dumped
 foreach my $id (1, 2) {
index bf36d1b..c72426c 100755 (executable)
@@ -139,7 +139,8 @@ sub populate_schema {
         [ 1, 'Caterwauler McCrae' ],
         [ 2, 'Random Boy Band' ],
         [ 3, 'We Are Goth' ],
-        [ 4, '' ] # Test overridden new will default name to "Test Name" using use_create => 1.
+        [ 4, '' ], # Test overridden new will default name to "Test Name" using use_create => 1.
+        [ 329482389748937, 'Big PK' ],
     ]);
 
     $schema->populate('CD', [
index 7c042ea..7b92a17 100644 (file)
                 "rel": "cds",
                 "quantity": "all"
             }]
-        }, {
+        },
+        
+        {
+            "class": "Artist",
+            "ids": ["329482389748937"],
+            "fetch": [{
+                "rel": "cds",
+                "quantity": "all"
+            }]
+        },
+      
+        {
             "class": "Artist",
             "ids": ["2"],
             "fetch": [{