forgejo/models/forgejo_migrations
forgejo-backport-action 5dc9f86f09 [v12.0/forgejo] fix: upgrade fails or hang at migration[32]: Migrate maven package name concatenation (#8613)
**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.
- Resolves forgejo/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>
2025-07-22 19:24:22 +02:00
..
v1_20
v1_22
main_test.go
migrate.go [v12.0/forgejo] fix: corrupted wiki unit default permission (#8234 follow-up) (#8439) 2025-07-07 20:23:20 +02:00
migrate_test.go
v13.go
v14.go
v15.go
v16.go
v17.go
v18.go
v19.go
v20.go
v21.go
v22.go
v23.go
v24.go
v25.go
v25_test.go
v26.go fix: match PackageBlob.HashBlake2b definition and migration (#7543) 2025-04-15 07:05:21 +00:00
v27.go
v28.go
v29.go feat(activitiypub): enable HTTP signatures on all ActivityPub endpoints (#7035) 2025-04-03 15:24:15 +00:00
v30.go add port and schema to federation host (#7203) 2025-04-16 08:07:51 +00:00
v30_test.go add port and schema to federation host (#7203) 2025-04-16 08:07:51 +00:00
v31.go fix: migrate repository.topics column for SQLite (#8019) 2025-06-03 10:20:05 +02:00
v31_test.go fix: ensure consistent empty repository topics field (#7920) 2025-05-29 22:39:53 +02:00
v32.go [v12.0/forgejo] fix: upgrade fails or hang at migration[32]: Migrate maven package name concatenation (#8613) 2025-07-22 19:24:22 +02:00
v32_test.go fix: maven use groupId:artifactId for package name concatenation (#6352) 2025-06-01 09:02:29 +02:00
v33.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
v33_test.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
v34.go bug: Forgejo Actions email notifications are opt-in (#8242) 2025-06-21 13:11:01 +02:00
v35.go [v12.0/forgejo] fix: disable Forgejo Actions email notifications on recovery (#8390) 2025-07-02 20:03:18 +02:00
v36.go [v12.0/forgejo] fix: corrupted wiki unit default permission (#8234 follow-up) (#8439) 2025-07-07 20:23:20 +02:00