fix: wrap migrations in transaction (#29664)