migration: Canonicalize historic queries
Created by: efritz
Extracted from #36319. This PR:
- Adds
canonicalizeQuery
which strips out some metadata added and removed in historic versions of our migration definition journey. - Drive-bys:
- Adds
NewDefinitions
to enable (later) external construction - Adds more information to an error message
- Adds
Test plan
Additional unit tests in this PR.