From: Johannes Plunien Date: Sat, 1 Nov 2008 20:38:40 +0000 (+0000) Subject: using unreserved table name for FK alter statements in oracle producer X-Git-Tag: v0.11008~284 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=541d6e24f4cd9d7cfe25e3e39b776892e52639ed;p=dbsrgits%2FSQL-Translator.git using unreserved table name for FK alter statements in oracle producer --- diff --git a/lib/SQL/Translator/Producer/Oracle.pm b/lib/SQL/Translator/Producer/Oracle.pm index 0677910..c3707a7 100644 --- a/lib/SQL/Translator/Producer/Oracle.pm +++ b/lib/SQL/Translator/Producer/Oracle.pm @@ -311,7 +311,7 @@ sub create_table { push @constraint_defs, "CONSTRAINT $name CHECK ($expression)"; } elsif ( $c->type eq FOREIGN_KEY ) { - $name = mk_name( join('_', $table_name, $c->fields). '_fk' ); + $name = mk_name( join('_', $table_name, $c->fields). '_fk' ); my $def = "CONSTRAINT $name FOREIGN KEY "; if ( @fields ) { @@ -335,12 +335,12 @@ sub create_table { $def .= ' ON DELETE '.join( ' ', $c->on_delete ); } - # disabled by plu 2007-12-29 - doesn't exist for oracle - #if ( $c->on_update ) { - # $def .= ' ON UPDATE '.join( ' ', $c->on_update ); - #} + # disabled by plu 2007-12-29 - doesn't exist for oracle + #if ( $c->on_update ) { + # $def .= ' ON UPDATE '.join( ' ', $c->on_update ); + #} - push @fk_defs, sprintf("ALTER TABLE %s ADD %s", $table, $def); + push @fk_defs, sprintf("ALTER TABLE %s ADD %s", $table_name_ur, $def); } }