Created by: efritz
This PR adds a check to the migrator up
and sg migration up
commands that will ensure that the upgrade is legal. Previously we would only check this in the frontend after a successful schema migration, which can lock the instance in a state that requires a downgrade (or nasty manual intervention). Fixes #37794 (closed).
Relevant changes (mostly broken up by commit):
cmd/frontend/backend/versions
to internal/version/upgradestore
so that it's a proper store interfaceStore
interface, which we need to use to construct the new upgradestore in the migratorRunner
caches stores as they're created (duplicate migration issues will happen if we double-request the same store, which we are about to do)up
migration subcommand that hits the new upgradestoreTODO:
Existing unit tests still remain; validated error condition by running sg migration up
locally with a dummy value in the versions
table.