Review 13.4 Merged

86993[BUGFIX] Adapt migration for changed folder_identifier SQL definition

Nikita Hovratov CR +2 V +2 Easy +4 −1 updated 11/15/24, 12:34

Commit message

With the introduction of automatic SQL column generation for type
`folder`, the migration for table sys_file_collection and field
folder_identifier broke due to a changed default value. Before the
change the default value was an empty string. Now it is NULL.

The new field `folder_identifier` got added with #97923 plus
the migration. This means users who are upgrading from v11 to v13
and skipping v12 will have the new default `NULL`.

The query is adapted to look for both the old and new default value.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 3

Files 1

Review log 911

  1. Nikita Hovratov uploaded patch set 1 11/14/24, 17:45

  2. core-ci voted on patch set 1 V +1 11/14/24, 17:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69442

  3. Benjamin Franzke commented on patch set 1 11/14/24, 20:06

    Can you explain how an old v11 record (that is to be migrated because v12 must have been skipped) can have the new v13 default value. The new-NULL-default should only have been applied to new records, which should not need a v12 migration. Can you share here or in the ticket an actual error and/or insights how this state could be established?
  4. Nikita Hovratov commented on patch set 1 11/14/24, 20:20

    Reply

    Exactly, I skipped v12. Pretty standard to skip one major version on updates. Field `folder_identifier` got added in v12 + migration, which I skipped. So it only was created with v13 having the new default `NULL`, which the migration wizard doesn't handle.
  5. Nikita Hovratov updated the commit message in patch set 2 V +1 11/14/24, 20:25

  6. core-ci voted on patch set 2 V +1 11/14/24, 20:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69444

  7. Garvin Hicking commented on patch set 2 CR +1 V +1 11/15/24, 08:45

    I personally don't skip major updates, but I setup a dummy installation like this and the upgrader then works. (sidenote, possible folder_identifier='' records stay at '' and are not converted to NULL through the DB compare, which is okay/expected I'd say, and they still work properly)
  8. Benjamin Franzke commented on patch set 2 CR +1 11/15/24, 08:46

    Reply

    Yea, perfectly fine to skip one major version. Good explanation and thanks for updating the commit message accordingly.
  9. Benjamin Franzke voted on patch set 2 V +1 11/15/24, 12:32

  10. Benjamin Franzke commented on patch set 2 CR +2 V +2 11/15/24, 12:34

    Reply

    Yes, that's ok, as it was added as a new field in v12. Existing records with string contents !== '' are therefore already migrated (or new)
  11. Benjamin Franzke merged patch set 3 11/15/24, 12:34