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
people
first_name
last
Hi You may add unique index in your migration to the columns for example
add_index(:accounts, [:branch_id, :party_id], :unique => true)
or separate unique indexes for each column