-
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
Index name 'index_taggings_on_tag_id' on table 'taggings' already exists #845
Comments
I had the same problem when I was putting [5.0] after the migration name so I tried with [4.2] instead and it worked! |
Just remove the following line from
Cause: |
Thanks @RaccoonFive ,I have the same problem, use [4.2] instead works! |
Added a |
Using Rails 5.1.3, after generating migrations with
So I fixed that error by just appending the missing Then when I ran
I fixed this by using advice from @stoplion by modifying db/migrate/20171104224110_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb by |
Caused by: On *_add_missing_unique_indices.acts_as_taggable_on_engine.rb file Change this line
to
You can reference my gist for migration errors and configuration. |
thanks |
When i try running rake db:migrate it outputs this
`C:\Sites\novosti>rails db:migrate
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2]
'C:/Sites/novosti/db/migrate/20170708123900_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb:2:in
<top (required)>' bin/rails:4:in
require'bin/rails:4:in `
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2]
C:/Sites/novosti/db/migrate/20170708123900_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb:2:in
<top (required)>' bin/rails:4:in
require'bin/rails:4:in
<main>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
I fixed it buy putting
[5.0]
on the end of the generatedacts_as_taggable_on_migration.acts_as_taggable_on_engine
But then i got this error
`C:\Sites\novosti>rake db:migrate
== 20170708144217 ActsAsTaggableOnMigration: migrating ========================
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- create_table(:tags, {:id=>:integer})
-> 0.0029s
-- adapter_name()
-> 0.0000s
-- adapter_name()
-> 0.0000s
-- create_table(:taggings, {:id=>:integer})
-> 0.0032s
-- add_index(:taggings, :tag_id)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Index name 'index_taggings_on_tag_id' on table 'taggings' already exists
C:/Sites/novosti/db/migrate/20170708144217_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb:23:in
up' ArgumentError: Index name 'index_taggings_on_tag_id' on table 'taggings' already exists C:/Sites/novosti/db/migrate/20170708144217_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb:23:in
up'Tasks: TOP => db:migrate
(See full trace by running task with --trace)`
The text was updated successfully, but these errors were encountered: