Fix change_column re-adding indexes without their options (#1344)
@b-nik Thanks for the PR. I assume it is to fix https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/1344 Could you add some tests to confirm it fixes the issue? Thanks
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?
@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 main branch. This can be done using:
RAILS_BRANCH=main bundle install
RAILS_BRANCH=main bundle exec rake test
@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 8-0-stable branch. Thanks for the PR!