Fix Cache Issue In Schema Difference Calculation For Log Tables #30697
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.
Overview
This pr solves a very specific caching issue related to calculation of schema difference between a table and its log table during the upgrades that includes multiple changes to the same table.
Technical Details
While upgrading from version 5.51.3 to 5.75.0 we change the columns post_URL and cancel_URL here for table civicrm_uf_group and later in the upgrade process we make changes to same table again here and this time civi also tries to sync log tables here if logging is enabled.
During this sync when civi is trying to find differences between civicrm_uf_group table and log_civicrm_uf_group table there appears to be an issue that in cache for civicrm_uf_group there exists both columns post_URL (old column name) and post_url (new column name) as well. And since post_URL does not exist in log_civicrm_uf_group it appears in the differences as a new column.
When civi tries to find the spec of this new column here from database there appears to be none due to which here it forms an incomplete query and thus results in an error. Same issue happens for cancel_URL column as well.
This pr adds an ability to refresh the table cache during schema difference calculations during the upgrades.