Skip to content

fix(core): create the system tag schema in core migrations - #67611

Open
susnux wants to merge 2 commits into
masterfrom
fix/systemtag-core-migrations
Open

susnux wants to merge 2 commits into
masterfrom
fix/systemtag-core-migrations

Conversation

@susnux

@susnux susnux commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The core system tag API (ISystemTagManager, ISystemTagObjectMapper) depends on the etag and color columns of oc_systemtag, and on master also on systemtag.id no longer being auto-incremented (snowflake ids). Until now only migrations of the optional systemtags app made these changes. The updater only migrates enabled apps, so instances where systemtags was disabled during the upgrade to 31 miss the columns. Anything that uses the core API, such as the dav /systemtags endpoints, workflowengine, occ tag:*, files_automatedtagging or recognize, then fails with Unknown column 'etag' (#58202, #58211).

On master the same applies to the auto-increment removal. On Oracle the leftover DBAL auto-increment trigger loops NEXTVAL up to the inserted snowflake id, so creating a tag would effectively hang.

This moves the schema changes into core:

  • Version31000Date20261203120000 adds etag and color if they are missing. It is named so the same class can be backported to stable31–35.
  • Version36000Date20261203120100 drops the auto-increment on systemtag.id, replacing the unreleased systemtags 36000 migration. It runs unconditionally because Doctrine does not report auto-increment for Oracle columns. On dev instances that already ran the app migration, Oracle only logs that the trigger is gone.
  • The app's 31000 migrations already skip existing columns, so they stay as no-ops.

Making the manager a no-op while the app is disabled was considered and rejected. The API is public and used by always-enabled apps, and tag-based access control rules would silently stop matching.

TODO

  • Backport Version31000Date20261203120000 (without the 36000 migration) to stable31–35

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The core system tag manager and object mapper rely on the etag and color
columns and on systemtag.id no longer being auto-incremented, but these
changes were only done by migrations of the optional systemtags app.
Instances where that app was disabled during an upgrade miss them, which
breaks the core tag API used by dav, workflowengine and other apps with
"Unknown column 'etag'". On Oracle the leftover auto-increment trigger
would even loop up to the inserted snowflake id.

The columns migration is kept backportable; the app's own 31000
migrations already skip existing columns, and its unreleased 36000
migration is superseded by the core one.

Fixes #67514

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Doctrine's Oracle schema manager never reports auto-increment when
reading a table, so skipping the drop based on the column state left
the trigger and sequence in place on Oracle. That is the case the
migration has to handle, so call dropAutoincrementColumn
unconditionally like the other snowflake migrations.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux marked this pull request as ready for review December 3, 2026 12:26
@susnux
susnux requested a review from a team as a code owner December 3, 2026 12:26
@susnux
susnux requested review from cristianscheid, leftybournes and salmart-dev and removed request for a team December 3, 2026 12:26
@susnux susnux added this to the Nextcloud 36 milestone Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core system tag code depends on columns created by the optional systemtags app

3 participants