Created by: efritz
Rewrite some long-squashed migration files so that up->down->up works idempotently.
Tested locally as part of #40958.