1. Let db be connection’s .

    2. Let transaction be a new upgrade transaction with connection used as . The scope of transaction includes every in connection.

    3. Set database’s upgrade transaction to transaction.

    4. Unset transaction’s .

    5. Let old version be db’s version.

    6. 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.

    7. to run these steps:

      1. Set request’s result to connection.

      2. Set transaction’s .

      3. Let didThrow be the result of running the steps to fire a version change event named at request with old version and version.

      4. Unset transaction’s .

    8. Wait for transaction to finish.