add_index(table_name, 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.
The index will be named after the table and the column name(s), unless you
pass :name as an option.
Creating a simple index
add_index(:suppliers, :name)
generates:
CREATE INDEX suppliers_name_index ON suppliers(name)
Creating a unique index
add_index(:accounts, [:branch_id, :party_id], unique: true)
generates:
CREATE