提交 072dbbf2 编写于 作者: A Aaron Patterson

pull add_column_options! off the pg connection class

上级 6b7fdf3b
......@@ -15,6 +15,19 @@ def visit_AlterTable(o)
sql
end
def add_column_options!(sql, options)
if options[:array] || options[:column].try(:array)
sql << '[]'
end
column = options.fetch(:column) { return super }
if column.type == :uuid && options[:default] =~ /\(\)/
sql << " DEFAULT #{options[:default]}"
else
super
end
end
end
def schema_creation
......
......@@ -627,19 +627,6 @@ def table_alias_length
@table_alias_length ||= query('SHOW max_identifier_length', 'SCHEMA')[0][0].to_i
end
def add_column_options!(sql, options)
if options[:array] || options[:column].try(:array)
sql << '[]'
end
column = options.fetch(:column) { return super }
if column.type == :uuid && options[:default] =~ /\(\)/
sql << " DEFAULT #{options[:default]}"
else
super
end
end
# Set the authorized user for this session
def session_auth=(user)
clear_cache!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册