Flowdock
method

index_name_for_remove

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: V4_2
index_name_for_remove(table_name, options = {}) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/migration/compatibility.rb, line 195
          def index_name_for_remove(table_name, options = {})
            index_name = connection.index_name(table_name, options)

            unless connection.index_name_exists?(table_name, index_name)
              if options.is_a?(Hash) && options.has_key?(:name)
                options_without_column = options.dup
                options_without_column.delete :column
                index_name_without_column = connection.index_name(table_name, options_without_column)

                if connection.index_name_exists?(table_name, index_name_without_column)
                  return index_name_without_column
                end
              end

              raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' does not exist"
            end

            index_name
          end
Register or log in to add new notes.