From: Ken Youens-Clark Date: Mon, 18 Aug 2003 15:43:15 +0000 (+0000) Subject: Minor cosmetic changes. X-Git-Tag: v0.04~309 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4524cf01f6ee980d3eca760ffb3012c698d11d11;p=dbsrgits%2FSQL-Translator.git Minor cosmetic changes. --- diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index f18981e..251781c 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::MySQL; # ------------------------------------------------------------------- -# $Id: MySQL.pm,v 1.25 2003-08-16 20:11:39 rossta Exp $ +# $Id: MySQL.pm,v 1.26 2003-08-18 15:43:14 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -24,7 +24,7 @@ package SQL::Translator::Producer::MySQL; use strict; use vars qw[ $VERSION $DEBUG ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.25 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.26 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -89,7 +89,7 @@ sub produce { my %extra = $field->extra; my $list = $extra{'list'} || []; # \todo deal with embedded quotes - my $commalist = "'" . join("','", @$list) . "'"; + my $commalist = join( ', ', map { qq['$_'] } @$list ); # # Oracle "number" type -- figure best MySQL type diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 1c995b9..ccb1fdb 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::PostgreSQL; # ------------------------------------------------------------------- -# $Id: PostgreSQL.pm,v 1.13 2003-08-17 00:46:23 rossta Exp $ +# $Id: PostgreSQL.pm,v 1.14 2003-08-18 15:43:15 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -30,7 +30,7 @@ SQL::Translator::Producer::PostgreSQL - PostgreSQL producer for SQL::Translator use strict; use vars qw[ $DEBUG $WARN $VERSION ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -197,16 +197,16 @@ sub produce { my $data_type = lc $field->data_type; my %extra = $field->extra; my $list = $extra{'list'} || []; - # \todo deal with embedded quotes - my $commalist = "'" . join("','", @$list) . "'"; + # todo deal with embedded quotes + my $commalist = join( ', ', map { qq['$_'] } @$list ); my $seq_name; if ( $data_type eq 'enum' ) { my $len = 0; $len = ($len < length($_)) ? length($_) : $len for (@$list); - my $check_name = mk_name( $table_name.'_'.$field_name, 'chk' ); + my $chk_name = mk_name( $table_name.'_'.$field_name, 'chk' ); push @constraint_defs, - "CONSTRAINT $check_name CHECK (\"$field_name\" IN ($commalist))"; + qq[CONSTRAINT $chk_name CHECK ("$field_name" IN ($commalist))]; $data_type = 'character varying'; } elsif ( $data_type eq 'set' ) { diff --git a/lib/SQL/Translator/Producer/Sybase.pm b/lib/SQL/Translator/Producer/Sybase.pm index 5e41140..fe2a1ab 100644 --- a/lib/SQL/Translator/Producer/Sybase.pm +++ b/lib/SQL/Translator/Producer/Sybase.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::Sybase; # ------------------------------------------------------------------- -# $Id: Sybase.pm,v 1.5 2003-08-17 01:11:54 rossta Exp $ +# $Id: Sybase.pm,v 1.6 2003-08-18 15:43:15 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark , # darren chamberlain , @@ -31,7 +31,7 @@ SQL::Translator::Producer::Sybase - Sybase producer for SQL::Translator use strict; use vars qw[ $DEBUG $WARN $VERSION ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use Data::Dumper; @@ -172,7 +172,7 @@ sub produce { my %extra = $field->extra; my $list = $extra{'list'} || []; # \todo deal with embedded quotes - my $commalist = "'" . join("','", @$list) . "'"; + my $commalist = join( ', ', map { qq['$_'] } @$list ); my $seq_name; if ( $data_type eq 'enum' ) {