Let db be connection’s .
Let transaction be a new upgrade transaction with connection used as . The scope of transaction includes every in connection.
Set database’s upgrade transaction to transaction.
Unset transaction’s .
Let old version be db’s version.
Set the version of db to version. This change is considered part of the , and so if the transaction is aborted, this change is reverted.
to run these steps:
Set request’s result to connection.
Set transaction’s .
Let didThrow be the result of running the steps to fire a version change event named at request with old version and version.
Unset transaction’s .
Wait for transaction to finish.