- Chris Hilton <chilton@alterpoint.com>
- Chris Mungall <cjm@fruitfly.org>
- Chris To <christot@users.sourceforge.net>
+- Colin Newell <colin.newell@gmail.com>
- Daniel Ruoso <daniel@ruoso.com>
- Darren Chamberlain <dlc@users.sourceforge.net>
- Dave Cash <dave@gnofn.org>
* Quote everything in SQL Server
* Turn off constraints before dropping tables in SQL Server
* Make true unique constraints if needed in SQL Server
+* Fixed Producer::PostgresSQL to output array type after type size,
+ i.e. varchar(64)[] rather than varchar[](64)
# ----------------------------------------------------------
# 0.11007 2010-11-30
my @size = $field->size;
my $data_type = lc $field->data_type;
+ my $array = $data_type =~ s/\[\]$//;
if ( $data_type eq 'enum' ) {
# my $len = 0;
} elsif ( defined $size[0] && $size[0] > 0 ) {
$data_type .= '(' . join( ',', @size ) . ')';
}
+ if($array)
+ {
+ $data_type .= '[]';
+ }
#
# Geography
#=============================================================================
BEGIN {
- maybe_plan(38,
+ maybe_plan(39,
'SQL::Translator::Producer::PostgreSQL',
'Test::Differences',
)
is($field1_sql, 'myfield character varying(10)', 'Create field works');
+my $field_array = SQL::Translator::Schema::Field->new( name => 'myfield',
+ table => $table,
+ data_type => 'character varying[]',
+ size => 10,
+ default_value => undef,
+ is_auto_increment => 0,
+ is_nullable => 1,
+ is_foreign_key => 0,
+ is_unique => 0 );
+
+my $field_array_sql = SQL::Translator::Producer::PostgreSQL::create_field($field_array);
+
+is($field_array_sql, 'myfield character varying(10)[]', 'Create field works');
+
my $field2 = SQL::Translator::Schema::Field->new( name => 'myfield',
table => $table,
data_type => 'VARCHAR',