pascal-za/migrant

Ability to define custom indexes

KieranP opened this issue · 1 comments

Need to be able to supply custom indexes.

class Vote
  belongs_to :user
  belongs_to :answer

  index [:user_id, :answer_id], :unique => true, :name => 'user_gets_one_vote_per_answer'
end

This could be useful, perhaps in a separate block.

If you just want to index a single column for now you can do

  structure do
    my_field :integer, :index => true
  end