diff --git a/lib/Test/SQL/Translator.pm b/lib/Test/SQL/Translator.pm index 0b2ade7a9..8fcce491e 100644 --- a/lib/Test/SQL/Translator.pm +++ b/lib/Test/SQL/Translator.pm @@ -49,7 +49,7 @@ my %ATTRIBUTES = ( constraint => { name => '', type => '', - deferrable => 1, + deferrable => 0, expression => '', is_valid => 1, fields => [], @@ -135,6 +135,11 @@ sub default_attribs { $hashref->{ $attr } = $ATTRIBUTES{ $object_type }{ $attr } } + # Special case + if ($object_type eq 'constraint' and $hashref->{type} eq FOREIGN_KEY) { + $hashref->{deferrable} = 1; + } + return $hashref; }