instance method
remove_index
Ruby on Rails 5.2.8.1
Since v2.2.3Signature
remove_index(table_name, options = {})
Removes the given index from the table.
Removes the index on branch_id in the accounts table if exactly one such index exists.
remove_index :accounts, :branch_id
Removes the index on branch_id in the accounts table if exactly one such index exists.
remove_index :accounts, column: :branch_id
Removes the index on branch_id and party_id in the accounts table if exactly one such index exists.
remove_index :accounts, column: [:branch_id, :party_id]
Removes the index named by_branch_party in the accounts table.
remove_index :accounts, name: :by_branch_party
Parameters
-
table_namereq -
optionsopt = {}
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb, line 786
def remove_index(table_name, options = {})
index_name = index_name_for_remove(table_name, options)
execute "DROP INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)}"
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb line 786
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::SchemaStatements