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 <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
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;
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
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 <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
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;
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' ) {
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 <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
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;
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' ) {