From: Ken Youens-Clark Date: Thu, 13 Aug 2009 15:21:29 +0000 (+0000) Subject: Added patch from user (RT#42548). X-Git-Tag: v0.11008~109 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=621cb859e42287ae861b25f9048b2403f0f06055;p=dbsrgits%2FSQL-Translator.git Added patch from user (RT#42548). --- diff --git a/t/47postgres-producer.t b/t/47postgres-producer.t index 91749ea..55d3e17 100644 --- a/t/47postgres-producer.t +++ b/t/47postgres-producer.t @@ -14,7 +14,7 @@ use FindBin qw/$Bin/; #============================================================================= BEGIN { - maybe_plan(22, + maybe_plan(24, 'SQL::Translator::Producer::PostgreSQL', 'Test::Differences', ) @@ -77,6 +77,42 @@ my $field3_sql = SQL::Translator::Producer::PostgreSQL::create_field($field3); is($field3_sql, 'time_field time NOT NULL', 'Create time field works'); +my $field3_datetime_with_TZ = SQL::Translator::Schema::Field->new( + name => 'datetime_with_TZ', + table => $table, + data_type => 'timestamp with time zone', + size => 7, +); + +my $field3_datetime_with_TZ_sql = + SQL::Translator::Producer::PostgreSQL::create_field( + $field3_datetime_with_TZ + ); + +is( + $field3_datetime_with_TZ_sql, + 'datetime_with_TZ timestamp(6) with time zone', + 'Create time field with time zone and size, works' +); + +my $field3_time_without_TZ = SQL::Translator::Schema::Field->new( + name => 'time_without_TZ', + table => $table, + data_type => 'time without time zone', + size => 2, +); + +my $field3_time_without_TZ_sql + = SQL::Translator::Producer::PostgreSQL::create_field( + $field3_time_without_TZ + ); + +is( + $field3_time_without_TZ_sql, + 'time_without_TZ time(2) without time zone', + 'Create time field without time zone but with size, works' +); + my $field4 = SQL::Translator::Schema::Field->new( name => 'bytea_field', table => $table, data_type => 'bytea',