What I need is a migration to apply unique constraint to a combination of columns. i.e. for a people table, a combination of first_name, last_Name and Dob should be unique.
people
first_name
last_Name
Dob
add_index :people, [:firstname, :lastname, :dob], :unique => true
2.1m questions
2.1m answers
60 comments
57.0k users