-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install / migration error on Rails 7.0.2.2 #1078
Comments
looks like a regression within rails, I was able to workaround via: # 20220319093244_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
# t.references :tag, foreign_key: { to_table: ActsAsTaggableOn.tags_table }
t.references :tag, foreign_key: { to_table: ActsAsTaggableOn.tags_table }, type: :bigint && # 20220319093245_add_missing_unique_indices.acts_as_taggable_on_engine.rb
# Mysql2::Error: Cannot drop index 'index_taggings_on_tag_id': needed in a foreign key constraint
# remove_index ActsAsTaggableOn.taggings_table, :tag_id if index_exists?(ActsAsTaggableOn.taggings_table, :tag_id) |
I can confirm the problem is also applicable to Rails 6.1.5. @dieter-medium's workaround works as on that version too. |
We've been having this issue and noticed a couple things, maybe someone can clarify what happened? Looking at commits starting Jan 6, Was that an intentional revert (and why) or a maybe bad merge? TYIA for any insight. 😃 |
I fixed my migration issue with the dropping of foreign key indexes by adding a function to be more careful about how it gets done...probably necessary b/c I'm on mysql. No guarantees this is the best way...just fixing it fast for myself but adding here in case it helps someone else:
|
Just had to change line 39 to:
|
The text was updated successfully, but these errors were encountered: