wazery / ratyrate

:star: A Ruby Gem that wraps the functionality of jQuery Raty library, and provides optional IMDB style rating.

Home Page:http://ratingmoviestore.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArgumentError: Index name 'index_rates_on_rater_id' on table 'rates' already exists

opened this issue · comments

ArgumentError: Index name 'index_rates_on_rater_id' on table 'rates' already exists

When running migrations Rails 5.1

Got this too. AFAIK, this is caused by the second migration created by Ratyrate, the one with name "[whatever]_create_rates.rb". Ratyrate attempts to create an index, add_index :rates, :rater_id, but, as I see, it is automatically created by the line t.belongs_to :rater. See here, "Add an appropriate index. Defaults to true".
I solved it by simply commenting the index line before migrating. Might need some extra attention. I'm going to try and see which code generates it.

commented

I've got this error. Please fixed it :(
thx.