Skip to content

fix(theming): move legacy color restore out of changeSchema - #67688

Open
kukanggg89 wants to merge 1 commit into
nextcloud:masterfrom
kukanggg89:fix-db-schema-check-theming-67569
Open

kukanggg89 wants to merge 1 commit into
nextcloud:masterfrom
kukanggg89:fix-db-schema-check-theming-67569

Conversation

@kukanggg89

Copy link
Copy Markdown
Contributor

Summary

Version2006Date20240905111627::changeSchema() restored the legacy system and user colors, so every occ db:schema:check and occ db:schema:expected run replayed those data changes against the live database. SchemaChecker only calls changeSchema() when it builds the expected schema, never postSchemaChange(), so this moves restoreSystemColors() and restoreUserColors() into postSchemaChange(). Real upgrades still run the restore, and schema checks stop touching data.

The existing migration tests now call postSchemaChange(), and a new test asserts changeSchema() touches no app config, no preferences, and no background jobs.

I could not run the test suite locally (no PHP toolchain on this machine), so the tests are verified by CI.

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes (n/a: no front-end change)
  • Documentation (manuals or wiki) has been updated or is not required (n/a: the fix aligns behavior with the existing docs, no doc change needed)
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature: component)
  • Milestone added for target branch/version (ex: 32.x for stable32)

AI (if applicable)

Drafted with help from Claude. I reviewed and revised every change myself before opening this PR.

SchemaChecker replays changeSchema() to build the expected schema, so
the data changes in the theming migration ran on every
`occ db:schema:check` and `occ db:schema:expected` run, and after every
`occ upgrade` on 35+. Moving the restore into postSchemaChange() keeps
the migration behavior during real upgrades while leaving schema checks
read-only.

The existing tests now drive postSchemaChange(), and a new test asserts
changeSchema() touches neither app config, preferences, nor the job list.

Fixes nextcloud#67569

Signed-off-by: parel <farelalfarizi89@gmail.com>
Assisted-by: Muse:Muse Spark 1.3
@kukanggg89
kukanggg89 requested a review from a team as a code owner December 4, 2026 07:34
@kukanggg89
kukanggg89 requested review from leftybournes and salmart-dev and removed request for a team December 4, 2026 07:34

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

Labels

None yet

Projects

None yet

1 participant