**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8609
- Some SQL queries were not being run in the transaction of v32, which could lead to the migration failing or hanging indefinitely.
- Use `db.WithTx` to get a `context.Context` that will make sure to run SQL queries in the transaction.
- Using `db.DefaultContext` is fine to be used as parent context for starting the transaction, in all cases of starting the migration `x` and `db.DefaultContext` will point to the same engine.
- Resolvesforgejo/forgejo#8580
## Testing
1. Have a v11 Forgejo database with a maven package.
2. Run this migration.
Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8613
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>