migrant icon indicating copy to clipboard operation
migrant copied to clipboard

Ability to define custom indexes

Open KieranP opened this issue 14 years ago • 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

KieranP avatar Nov 24 '11 22:11 KieranP

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

pascal-za avatar Nov 24 '11 22:11 pascal-za