From: Jess Robinson Date: Sat, 26 Aug 2006 11:30:31 +0000 (+0000) Subject: Default auto-inc fields to start at one, and increase by one X-Git-Tag: v0.11008~410 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3866f0ff296ba9b17456b0debff690aa2465a0cc;p=dbsrgits%2FSQL-Translator.git Default auto-inc fields to start at one, and increase by one --- diff --git a/lib/SQL/Translator/Producer/DB2.pm b/lib/SQL/Translator/Producer/DB2.pm index 3f49293..2f0fb32 100644 --- a/lib/SQL/Translator/Producer/DB2.pm +++ b/lib/SQL/Translator/Producer/DB2.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::DB2; # ------------------------------------------------------------------- -# $Id: DB2.pm,v 1.3 2006-06-07 16:02:54 schiffbruechige Exp $ +# $Id: DB2.pm,v 1.4 2006-08-26 11:30:31 schiffbruechige Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -39,7 +39,7 @@ Creates an SQL DDL suitable for DB2. use warnings; use strict; use vars qw[ $VERSION $DEBUG $WARN ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -52,7 +52,7 @@ use SQL::Translator::Utils qw(header_comment); # of SQL data types, with field->extra entries being used to convert back to # weird types like "polygon" if needed (IMO anyway) -my %dt_translate = ( ); +my %dt_translate; BEGIN { %dt_translate = ( # @@ -306,7 +306,7 @@ sub create_field my $field_def = "$field_name $data_type"; $field_def .= $field->is_auto_increment ? - ' GENERATED BY DEFAULT AS IDENTITY' : ''; + ' GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1)' : ''; $field_def .= $data_type =~ /CHAR/i ? "(${size})" : ''; $field_def .= !$field->is_nullable ? ' NOT NULL':''; # $field_def .= $field->is_primary_key ? ' PRIMARY KEY':'';