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
1 | t.index( :name ) |
Creating a unique index
1 | t.index([ :branch_id , :party_id ], unique: true ) |
Creating a named index
1 | t.index([ :branch_id , :party_id ], unique: true , name: 'by_branch_party' ) |
Please login to continue.