From: Robert Bohne Date: Tue, 19 Jul 2011 12:29:53 +0000 (+0200) Subject: Call ->on_delete & ->on_update in SCALAR context not in LIST context X-Git-Tag: v0.11011~74 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5863ad875df6a45c0608cdef2f9ee1ce37cc056f;p=dbsrgits%2FSQL-Translator.git Call ->on_delete & ->on_update in SCALAR context not in LIST context --- diff --git a/AUTHORS b/AUTHORS index 7a64963..2a50740 100644 --- a/AUTHORS +++ b/AUTHORS @@ -32,6 +32,7 @@ The following people have contributed to the SQLFairy project: - Moritz Onken - Paul Harrington - Peter Rabbitson +- Robert Bohne - Ross Smith II - Ryan D Johnson - Sam Angiuoli diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index 694cf74..b277248 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -801,11 +801,11 @@ sub create_constraint } if ( $c->on_delete ) { - $def .= ' ON DELETE '.join( ' ', $c->on_delete ); + $def .= ' ON DELETE '. $c->on_delete; } if ( $c->on_update ) { - $def .= ' ON UPDATE '.join( ' ', $c->on_update ); + $def .= ' ON UPDATE '. $c->on_update; } return $def; } diff --git a/lib/SQL/Translator/Producer/Oracle.pm b/lib/SQL/Translator/Producer/Oracle.pm index 5db9d7d..4bc2a94 100644 --- a/lib/SQL/Translator/Producer/Oracle.pm +++ b/lib/SQL/Translator/Producer/Oracle.pm @@ -400,12 +400,12 @@ sub create_table { } if ( $c->on_delete ) { - $def .= ' ON DELETE '.join( ' ', $c->on_delete ); + $def .= ' ON DELETE '.$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 ); + # $def .= ' ON UPDATE '. $c->on_update; #} push @fk_defs, sprintf("ALTER TABLE %s ADD %s", $table_name_q, $def); diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 5f3d745..7507c16 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -637,11 +637,11 @@ sub create_constraint } if ( $c->on_delete ) { - $def .= ' ON DELETE '.join( ' ', $c->on_delete ); + $def .= ' ON DELETE '. $c->on_delete; } if ( $c->on_update ) { - $def .= ' ON UPDATE '.join( ' ', $c->on_update ); + $def .= ' ON UPDATE '. $c->on_update; } if ( $c->deferrable ) {