From: Arthur Axel 'fREW' Schmidt Date: Thu, 10 Mar 2011 03:49:18 +0000 (-0600) Subject: delete dead code X-Git-Tag: v0.11011~27^2~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8602eaebbbbd55253744498422acff907ab725d3;p=dbsrgits%2FSQL-Translator.git delete dead code --- diff --git a/lib/SQL/Translator/Producer/SQLServer.pm b/lib/SQL/Translator/Producer/SQLServer.pm index 4dbfee0..5538924 100644 --- a/lib/SQL/Translator/Producer/SQLServer.pm +++ b/lib/SQL/Translator/Producer/SQLServer.pm @@ -49,35 +49,6 @@ use SQL::Translator::Generator::DDL::SQLServer; my $util = SQL::Translator::Generator::Utils->new( quote_chars => ['[', ']'] ); my $future = SQL::Translator::Generator::DDL::SQLServer->new(); -my %translate = ( - date => 'datetime', - 'time' => 'datetime', - # Sybase types - #integer => 'numeric', - #int => 'numeric', - #number => 'numeric', - #money => 'money', - #varchar => 'varchar', - #varchar2 => 'varchar', - #timestamp => 'datetime', - #text => 'varchar', - #real => 'double precision', - #comment => 'text', - #bit => 'bit', - #tinyint => 'smallint', - #float => 'double precision', - #serial => 'numeric', - #boolean => 'varchar', - #char => 'char', - #long => 'varchar', -); - -# If these datatypes have size appended the sql fails. -my @no_size = qw/tinyint smallint int integer bigint text bit image datetime/; - -my $max_id_length = 128; -my %global_names; - =pod =head1 SQLServer Create Table Syntax @@ -94,8 +65,6 @@ sub produce { my $add_drop_table = $translator->add_drop_table; my $schema = $translator->schema; - %global_names = (); #reset - my $output; $output .= header_comment."\n" unless ($no_comments); @@ -183,27 +152,6 @@ sub produce { } =cut -sub mk_name { - my ($name, $scope, $critical) = @_; - - $scope ||= \%global_names; - if ( my $prev = $scope->{ $name } ) { - my $name_orig = $name; - $name .= sprintf( "%02d", ++$prev ); - substr($name, $max_id_length - 3) = "00" - if length( $name ) > $max_id_length; - - warn "The name '$name_orig' has been changed to ", - "'$name' to make it unique.\n" if $WARN; - - $scope->{ $name_orig }++; - } - $name = substr( $name, 0, $max_id_length ) - if ((length( $name ) > $max_id_length) && $critical); - $scope->{ $name }++; - return unreserve($name); -} - sub unreserve { $util->quote($_[0]) } 1;