From: Ken Youens-Clark <kclark@cpan.org>
Date: Mon, 29 Sep 2003 14:55:26 +0000 (+0000)
Subject: Kill size attribute if field data type is "text."
X-Git-Tag: v0.04~163
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d3f63791e99da2ea2444c4d2068f84c6c4ec732;p=dbsrgits%2FSQL-Translator.git

Kill size attribute if field data type is "text."
---

diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm
index 251781c..5ba95b9 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.26 2003-08-18 15:43:14 kycl4rk Exp $
+# $Id: MySQL.pm,v 1.27 2003-09-29 14:55:26 kycl4rk Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
 #                    darren chamberlain <darren@cpan.org>,
@@ -24,7 +24,7 @@ package SQL::Translator::Producer::MySQL;
 
 use strict;
 use vars qw[ $VERSION $DEBUG ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.26 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.27 $ =~ /(\d+)\.(\d+)/;
 $DEBUG   = 0 unless defined $DEBUG;
 
 use Data::Dumper;
@@ -113,11 +113,14 @@ sub produce {
                 $data_type = $translate{ $data_type };
             }
 
+            @size = () if $data_type eq 'text';
+
             $field_def .= " $data_type";
             
             if ( lc $data_type eq 'enum' ) {
                 $field_def .= '(' . $commalist . ')';
-			} elsif ( defined $size[0] && $size[0] > 0 ) {
+			} 
+            elsif ( defined $size[0] && $size[0] > 0 ) {
                 $field_def .= '(' . join( ', ', @size ) . ')';
             }