Support rails5 in postgres indexes function and fix some migrations
What does this MR do?
The changes in postgresql_opclasses_support.rb
and 20160226114608_add_trigram_indexes_for_searching.rb
are a backport of https://github.com/rails/rails/commit/1d8d5a74b81b8aab1f5e6d233d509a92525ed4e1#diff-6e377cf054cb4121e6f207bd7c14b492.
The change to 20170622135728_add_unique_constraint_to_ci_variables.rb
is needed because migrations now include compatibility: https://github.com/rails/rails/blob/5-0-stable/activerecord/lib/active_record/migration/compatibility.rb#L87 and this line call the index_name as a function.
The change to 20180201110056_add_foreign_keys_to_todos.rb
is needed because https://github.com/rails/rails/commit/6bd777c85156aca0cf2d1f34d8c1fe37d96ac3d9 changed the foreign key check to first check on column instead of checking the name, and this new check returns the author_id
foreign key.
The change to 20171106155656_turn_issues_due_date_index_to_partial_index.rb
is needed because https://github.com/rails/rails/commit/9771f5e178ebc1b8c5a61f813373ca3b7bd983c8#diff-a0775e1ec64264dc76a8ee71a5211ae3 broke the index_exists?
method for column name nil
With these changes RAILS5=1 bin/rails db:migrate
works fine. Schema dumping does not work yet because of the added support of comments on indexes.
Are there points in the code the reviewer needs to double check?
Should I split this MR into seperate ones? Made sense to do it like this until RAILS5=1 bin/rails db:migrate
worked and most background migration specs passed.
Why was this MR needed?
rails5 upgrade
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conform by the code review guidelines
-
Has been reviewed by a UX Designer -
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conform by the merge request performance guides -
Conform by the style guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #46236 (closed)