instance method
index
Ruby on Rails 4.0.13
Since v4.0.13Signature
index(column_name, options = {})
Adds index options to the indexes hash, keyed by column name This is primarily used to track indexes that need to be created after the table
index(:account_id, name: 'index_projects_on_account_id')
Parameters
-
column_namereq -
optionsopt = {}
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 241
def index(column_name, options = {})
indexes[column_name] = options
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 241
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::TableDefinition