if you upgrade nextcloud and are on an older mariadb version, upgrade to >= 10.6.9 that can handle (historically present) compressed rows without config option change
The upgrade process isn’t as comfortable as with other php packages relying on doctrine for migrations. A version check also prohibits running migrations in a target runtime (php 8.1), at least it isn’t supported. You need to go in stages if you’re on an EoL php version first (used 7.4 as intermediate). Also step-by-step for each nextcloud version - not just run migrations and be done. I’m spoiled.
In the past I used composer to do the upgrades and ran into issues too, it seemed not to be a widely used practice. I rely on the cli upgrade since.