instance method
index
Ruby on Rails 7.2.3
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 -
optionskeyrest
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 518
def index(column_name, **options)
indexes << [column_name, options]
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb line 518
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::TableDefinition