Updates to the Turnkey templates for atoms, tt2 templates, and xml
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / MySQL.pm
index c4bf9fe..b0e787f 100644 (file)
@@ -1,11 +1,9 @@
 package SQL::Translator::Producer::MySQL;
 
 # -------------------------------------------------------------------
-# $Id: MySQL.pm,v 1.30 2004-02-04 21:09:54 kycl4rk Exp $
+# $Id: MySQL.pm,v 1.32 2004-04-01 16:18:55 kycl4rk Exp $
 # -------------------------------------------------------------------
-# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
-#                    darren chamberlain <darren@cpan.org>,
-#                    Chris Mungall <cjm@fruitfly.org>
+# Copyright (C) 2002-4 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -46,7 +44,7 @@ for fields, etc.).
 
 use strict;
 use vars qw[ $VERSION $DEBUG ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.30 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/;
 $DEBUG   = 0 unless defined $DEBUG;
 
 use Data::Dumper;
@@ -134,6 +132,13 @@ sub produce {
                     $data_type = 'int';
                 }
             }
+            #
+            # Convert a large Oracle varchar to "text"
+            #
+            elsif ( lc $data_type eq 'varchar2' && $size[0] > 255 ) {
+                $data_type = 'text';
+                @size      = ();
+            }
             elsif ( exists $translate{ lc $data_type } ) {
                 $data_type = $translate{ lc $data_type };
             }