How can I add unique: true constraint to already existing index in Rails database?
unique: true
I tried to migrate by
def change add_index :editabi
Remove the old index and add it again with the new constraint:
def change remove_index :editabilities, [:user_id, :list_id] add_index :editabilities, [:user_id, :list_id], unique: true end