From: Daniel Ruoso Date: Mon, 14 Apr 2008 14:05:49 +0000 (+0000) Subject: Define a name for pk constraint when delay_constraints is on X-Git-Tag: v0.11008~323 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4977f1c59616e79fae20b68b71ebc94383fb922;p=dbsrgits%2FSQL-Translator.git Define a name for pk constraint when delay_constraints is on --- diff --git a/lib/SQL/Translator/Producer/Oracle.pm b/lib/SQL/Translator/Producer/Oracle.pm index 63e5570..93ddce1 100644 --- a/lib/SQL/Translator/Producer/Oracle.pm +++ b/lib/SQL/Translator/Producer/Oracle.pm @@ -419,7 +419,9 @@ sub create_table { next if !@fields && $c->type ne CHECK_C; if ( $c->type eq PRIMARY_KEY ) { - #$name ||= mk_name( $table_name, 'pk' ); + # create a name if delay_constraints + $name ||= mk_name( $table_name, 'pk' ) + if $options->{delay_constraints}; push @constraint_defs, ($name ? "CONSTRAINT $name " : '') . 'PRIMARY KEY (' . join( ', ', @fields ) . ')'; }