{ is_foreign_key_constraint => 0, on_delete => undef } is a valid construct - no...
Peter Rabbitson [Fri, 23 Oct 2009 08:52:49 +0000 (08:52 +0000)]
lib/SQL/Translator/Parser/DBIx/Class.pm

index 2ee47d5..b570d60 100644 (file)
@@ -184,7 +184,7 @@ sub parse {
                     if ($fk_constraint) {
                         $cascade->{$c} = $rel_info->{attrs}{"on_$c"};
                     }
-                    else {
+                    elsif ( $rel_info->{attrs}{"on_$c"} ) {
                         carp "SQLT attribute 'on_$c' was supplied for relationship '$moniker/$rel', which does not appear to be a foreign constraint. "
                             . "If you are sure that SQLT must generate a constraint for this relationship, add 'is_foreign_key_constraint => 1' to the attributes.\n";
                     }