Using rails, I set up a HATBM model with a users table, a groups table and a groups_users for the joins (all with scaffold command). Now I want to add a migration to add a uniqu
Your "groups_users" table has duplicate data in it so you'd have to either manually clear out the dupes or just reset your database with rake db:reset
.
Once you've cleared the duplicates, either by removing all the data from the database or finding the dupes, you should be able to run rake db:migrate
without error.
PS, make sure you have a backup of your db before you run the command above because it is destructive.