Skip to content

Make SchemaCacheWithRenamedTable compatible with Rails 7.1

Albert requested to merge 427574-update-schema-cache-rails-7-1 into master

What does this MR do and why?

SchemaCacheWithRenamedTable overrides some methods in ActiveRecord::ConnectionAdapters::SchemaCache.

In 7.1, the method parameters in ActiveRecord::ConnectionAdapters::SchemaCache has been changed to have connection as the first parameter. It was (table_name) and now it is (connection, table_name).

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

To verify this works with Rails 7.0.8:

  1. Start a console bin/rails console and ensure Rails console is up and running.

To verify this works with Rails 7.1:

  1. Check out the HEAD of this test MR !131865 (closed). It contains the upgraded Rails gem and other patches required to get Rails console working.
  2. Apply the diff from this MR onto the Rails 7.1 branch.
  3. Start a console bin/rails console and ensure Rails console is up and running.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #427574 (closed)

Edited by Albert

Merge request reports

Loading