From: John Napiorkowski Date: Thu, 13 Sep 2012 15:52:13 +0000 (-0400) Subject: test case for large pks and handle more pg date like types X-Git-Tag: 1.001017~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=017d2ab476491cf80dbfb102d5a2f3df6d490c8e;p=dbsrgits%2FDBIx-Class-Fixtures.git test case for large pks and handle more pg date like types --- diff --git a/Changes b/Changes index 0084543..a73508a 100644 --- 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 diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index c4d30fa..4b1f137 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -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); } diff --git a/t/04-dump-fetch.t b/t/04-dump-fetch.t index ad7bfda..e1e9a24 100644 --- a/t/04-dump-fetch.t +++ b/t/04-dump-fetch.t @@ -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) { diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index bf36d1b..c72426c 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -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', [ diff --git a/t/var/configs/fetch.json b/t/var/configs/fetch.json index 7c042ea..7b92a17 100644 --- a/t/var/configs/fetch.json +++ b/t/var/configs/fetch.json @@ -12,7 +12,18 @@ "rel": "cds", "quantity": "all" }] - }, { + }, + + { + "class": "Artist", + "ids": ["329482389748937"], + "fetch": [{ + "rel": "cds", + "quantity": "all" + }] + }, + + { "class": "Artist", "ids": ["2"], "fetch": [{