Skip to content
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

Rolling back add_index should use the same concurrently algorithm #24190

Closed
jturkel opened this issue Mar 14, 2016 · 4 comments
Closed

Rolling back add_index should use the same concurrently algorithm #24190

jturkel opened this issue Mar 14, 2016 · 4 comments

Comments

@jturkel
Copy link
Contributor

jturkel commented Mar 14, 2016

Steps to reproduce

  • Create and run the following migrations to create a products table with an index:
class CreateProducts < ActiveRecord::Migration[5.0]
  def change
    create_table :products do |t|
      t.string :name
    end
  end
end
class AddProductNameIndex < ActiveRecord::Migration[5.0]
  disable_ddl_transaction!

  def change
    add_index(:products, :name, algorithm: :concurrently)
  end
end
  • Run rake db:migrate to run the migrations
  • Run rake db:rollback to undo the index migration

Expected behavior

Since the migration created the index concurrently, I would expect undoing it to drop the index concurrently i.e. run the following SQL:

DROP INDEX CONCURRENTLY "index_products_on_name"

Actual behavior

Currently undoing the migration does not drop the index concurrently i.e. it runs the following SQL:

DROP INDEX "index_products_on_name"

System configuration

Rails version: 5.0.0.beta3

Ruby version: ruby-2.2.2

@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 5-0-stable branch or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@jturkel
Copy link
Contributor Author

jturkel commented Jul 15, 2016

I've confirmed this is still an issue on master.

@maclover7 maclover7 removed the stale label Jul 15, 2016
@tibbon
Copy link

tibbon commented Sep 20, 2017

Still an open issue? I might tackle this one this week or so.

@jturkel
Copy link
Contributor Author

jturkel commented Sep 20, 2017

It is still an issue. There does seem to be an open PR for it though: #24199

meinac added a commit to meinac/rails that referenced this issue Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants