All of the upgrade logic is performed within a single transaction, ensuring that if anything goes wrong it will all be rolled back. Note also that we use a different `runUpgradeInTransaction` method; see below.