File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def extract_limit(sql_type) # :nodoc:
15
15
end
16
16
17
17
# Extracts the value from a PostgreSQL column default definition.
18
- def extract_value_from_default ( default ) # :nodoc:
18
+ def extract_value_from_default ( default )
19
19
case default
20
20
# Quoted types
21
21
when /\A [\( B]?'(.*)'.*::"?([\w . ]+)"?(?:\[ \] )?\z /m
@@ -41,10 +41,13 @@ def extract_value_from_default(default) # :nodoc:
41
41
end
42
42
end
43
43
44
- def extract_default_function ( default_value , default ) # :nodoc:
45
- default if ! default_value && ( %r{ \w + \( .* \) | \( .* \) :: \w +} === default )
44
+ def extract_default_function ( default_value , default )
45
+ default if has_default_function? ( default_value , default )
46
46
end
47
47
48
+ def has_default_function? ( default_value , default )
49
+ !default_value && %r{\w +\( .*\) |\( .*\) ::\w +|CURRENT_DATE|CURRENT_TIMESTAMP} === default
50
+ end
48
51
end
49
52
50
53
end
You can’t perform that action at this time.
0 commit comments