-
Notifications
You must be signed in to change notification settings - Fork 6
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
create index concurrently fails in standard migrations #3
Comments
I'll take a look at this when I have a chance. This looks like it has to do with migrations being wrapped completely in transactions to allow for rollbacks on DDL changes. |
I think Rails 4 will take care of this |
Sweet. We aren't ready to make the jump to Rails 4 yet, but I have done some work on Rails 4 compatibility in the rails-4 branch. Wonder if this would be worth a backport. |
For anyone seeing this from a google search, in modern rails you can add |
I got the same error message using Goose for GoLang and this worked -- (removing the execute commands and adding the semicolons)
|
Creating concurrent indexes cannot be done within a transaction in PG.
All AR migrations occur within a transaction.
If you try, you'll get the following error
PGError: ERROR: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
to work around this issue I needed to do the following in my migration
it would be nice to somehow remove this boilerplate.
The text was updated successfully, but these errors were encountered: