提交 2809f38a 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #27986 from kamipo/add_default_index_type

Add `default_index_type?` to the generic schema dumper doesn't have the knowledge about an index type
......@@ -509,6 +509,10 @@ def combine_bind_parameters(
result
end
def default_index_type?(index) # :nodoc:
index.using.nil?
end
private
def initialize_type_map(m)
......
......@@ -651,6 +651,10 @@ def valid_type?(type)
!native_database_types[type].nil?
end
def default_index_type?(index) # :nodoc:
index.using == :btree || super
end
private
def initialize_type_map(m)
......
......@@ -402,6 +402,10 @@ def postgresql_version
@connection.server_version
end
def default_index_type?(index) # :nodoc:
index.using == :btree || super
end
private
# See http://www.postgresql.org/docs/current/static/errcodes-appendix.html
......
......@@ -188,7 +188,7 @@ def index_parts(index)
index_parts << "length: { #{format_options(index.lengths)} }" if index.lengths.present?
index_parts << "order: { #{format_options(index.orders)} }" if index.orders.present?
index_parts << "where: #{index.where.inspect}" if index.where
index_parts << "using: #{index.using.inspect}" if index.using && index.using != :btree
index_parts << "using: #{index.using.inspect}" if !@connection.default_index_type?(index)
index_parts << "type: #{index.type.inspect}" if index.type
index_parts << "comment: #{index.comment.inspect}" if index.comment
index_parts
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册