From 2ec331ee80d7ef1f689cc17746794879b7faf0ac Mon Sep 17 00:00:00 2001 From: Alastair McGowan-Douglas Date: Tue, 3 Nov 2015 10:39:00 +0000 Subject: [PATCH] Special-case the default deferrable value in tests --- lib/Test/SQL/Translator.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }