instance method
remove_index
Ruby on Rails 2.3.18
Since v2.2.3Signature
remove_index(table_name, options = {})
Remove the given index from the table.
Remove the suppliers_name_index in the suppliers table.
remove_index :suppliers, :name
Remove the index named accounts_branch_id_index in the accounts table.
remove_index :accounts, :column => :branch_id
Remove the index named accounts_branch_id_party_id_index in the accounts table.
remove_index :accounts, :column => [:branch_id, :party_id]
Remove 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 305
def remove_index(table_name, options = {})
index_name = index_name(table_name, options)
unless index_exists?(table_name, index_name, true)
@logger.warn("Index name '#{index_name}' on table '#{table_name}' does not exist. Skipping.")
return
end
remove_index!(table_name, index_name)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb line 305
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::SchemaStatements