From: Justin Hunter Date: Sat, 5 Sep 2009 16:46:25 +0000 (-0700) Subject: make sure reference fields is an arrayref X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=859b70aaf6d8be8fb26045d016e59b1fc8d23e08;p=dbsrgits%2FSQL-Translator-2.0-ish.git make sure reference fields is an arrayref --- diff --git a/lib/SQL/Translator/Parser/DDL/SQLite.pm b/lib/SQL/Translator/Parser/DDL/SQLite.pm index b24307b..69dd24e 100644 --- a/lib/SQL/Translator/Parser/DDL/SQLite.pm +++ b/lib/SQL/Translator/Parser/DDL/SQLite.pm @@ -91,7 +91,7 @@ role SQL::Translator::Parser::DDL::SQLite { $constraint = ForeignKey->new({ name => $cdata->{name} || 'foreign_key', table => $table, reference_table => $cdata->{reference_table}, - reference_columns => $cdata->{reference_fields}, + reference_columns => ref $cdata->{reference_fields} ? $cdata->{reference_fields} : [ $cdata->{reference_fields} ], on_delete => $cdata->{on_delete} || $cdata->{on_delete_do}, on_update => $cdata->{on_update} || $cdata->{on_update_do} }); $table->get_column($_)->is_foreign_key(1) for @{$cdata->{fields}};