-
Notifications
You must be signed in to change notification settings - Fork 566
Maintain index options during change_column
operations
#1345
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
Conversation
No problem, I'll have to check how to run tests for this, and how to write appropriate tests to actually test this case (I'm not too well versed in the rails adapter internals) when I have more time, and I'll get back to you. Btw I manually tested this on a Rails 8.0 app so hopefully this fix can be backported on 8.0 as well and not just for 8.1. |
@aidanharan Trying to run the tests I noticed that the main branch is using an activerecord version ( 8.1.0alpha ) that doesn't seem to exist? Am I missing something? |
You need to run the tests against the Rails RAILS_BRANCH=main bundle install
RAILS_BRANCH=main bundle exec rake test |
change_column
operations
@b-nik I added a test to the PR. Could you review it please? |
@aidanharan Looks good - I added an extra test case with multiple indexes and index options to check they are all retained. |
@b-nik I have back-ported the fix to the |
Maintain index options during change_column operations.
Fixes #1344