index(column_name, options = {})
Instance Public methods
Adds a new index to the table. column_name
can be a single Symbol, or an Array of Symbols. See ActiveRecord::ConnectionAdapters::SchemaStatements#add_index
Creating a simple index
t.index(:name)
Creating a unique index
t.index([:branch_id, :party_id], unique: true)
Creating a named index
t.index([:branch_id, :party_id], unique: true, name: 'by_branch_party')
Please login to continue.