Use adapter support flags instead of checking adapter type in INDEX INCLUDE
tests
#54532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
This PR updates the
INDEX INCLUDE
tests inactiverecord/test/cases/migration/index_test.rb
to run based on support flags rather than the adapter type.Detail
PostgreSQL is the only core adapter (PostgreSQL/MySQL/SQLite/Trilogy) that support
INDEX INCLUDE
. However, SQL Server also supportsINDEX INCLUDE
and I would like to reuse the Rails tests in ActiveRecord SQL Server Adapter instead of recreating them in the adapter.The tests currently check if the adapter is PostgreSQL and that
INDEX INCLUDE
is supported. The check to see if the adapter is PostgreSQL is not needed.Removing the PostgreSQL adapter check makes it necessary to check if
PARTIAL INDEX
is supported in a separate test.Also, removed the following check as its a list of all the core adapters and so does nothing:
The changes are small and better viewed in the diff with the
Hide whitespace
option enabled.Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]