Improve UpdateManager service methods.

Created on 21 July 2025, 12 days ago

Problem/Motivation

  1. The removeColumn method is still spotty with restoring data as its retaining the removed columns in some cases for the data to be restored.
  2. We need a new method to add additional extra columns to existing subfields. For example, so we can reuse our logic in update hooks to add an additional 'timezone' column to datetime fields.

Proposed resolution

  1. For the removeColumn issue, after using the addColumn() method to create a new column on tables with existing data, the restoreData method can sometimes fail as it may still include the removed column in the data to restore. For large data sets, it's inefficient to try to remove these columns through a loop so instead, we can modify the query for the data to restore to filter to only the leftover columns.
  2. For the extra columns, we can introduce a new addExtraColumns() method that receives an array of $extra_columns data to build new columns.

API changes

New addExtraColumns() method will be added to the CustomFieldUpdateManager service mostly intended as an internal helper but can be used by users in an update hook for adding extra columns to extended sub-fields.

πŸ“Œ Task
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apmsooner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024