Database records with FlexForm columns don't auto-upgrade when new fields are added in the flexform. When adding a new select field in a plugin configuration (or a flux content element), I can't rely on the field having the default value in all content elements - because the values of newly added fields are only stored in the database when editing the content elements. This makes code larger because I have to account for not-yet-existing values.
Example: A "color" select field with a default value that we just output into a class attribute:
<a class="{settings.color}">...</a>
Putting a check/switch in there makes the code much more verbose and unreadable.
What would be a good way to adjust the database records of existing (plugin) content elements when flexforms change?
The lowlevel cleanup:flexforms command only removes values for non-existing fields AFAIK.
cleanup:flexformsdoes not add those to the database. Only when removing fields from flexform - those fields get removed from database.