forgejo/models/forgejo_migrations
forgejo-backport-action 1d838c8d5e [v12.0/forgejo] fix: corrupted wiki unit default permission (#8234 follow-up) (#8439)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8258

Closes #8119, follow-up of #8234

#8234 "only" fixed the case when a new wiki setting was applied.

However it lacked 2 aspects:
- fixing the already corrupted unit permission in the database (required a migration)
- fixing the API route

Both aspects should now be covered.

Additionally, I commented out the unused `UnitAccessMode` and indicated that they are only used for the wiki-unit (hopefully saving some time to future code-readers).

### Testing

- go to a commit before #8234 (e.g. 285f66b782)
- create 3 repositories
  - save the wiki settings of the second, without any change
  - set the wiki of the third to be globally writable
- verify the `default_permissions` column in the database, of the unit `5`: 0, 2, 3
- stop Forgejo, switch to this PR and start Forgejo
- verify that the logs writes `Migration[35]: Fix wiki unit default permission`
- verify the `default_permissions` column in the database, of the unit `5`: 0, 0, 3

Before:

![2025-06-23-150055.png](/attachments/1eb92507-b8b4-422c-921c-4296a91172e7)

After:

![2025-06-23-150853.png](/attachments/c7b53397-54fe-487d-89da-e10b26538cde)

- [x] I did not document these changes and I do not expect someone else to do it.
- [x] I do not want this change to show in the release notes.

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8439
Reviewed-by: Earl Warren <earl-warren@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-07 20:23:20 +02:00
..
v1_20 chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v1_22 Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
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 chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v13.go [FEAT]Add Option to hide Release Archive links (#3139) 2024-04-24 15:15:55 +00:00
v14.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v15.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v16.go add migration & enhance int-test 2024-05-16 18:25:16 +02:00
v17.go add migration & enhance int-test 2024-05-16 18:25:16 +02:00
v18.go fix: Use correct table in migration v18 (#7114) 2025-03-04 16:44:37 +00:00
v19.go Implement external assets 2024-07-29 20:35:55 +02:00
v20.go feat(quota): Humble beginnings of a quota engine 2024-08-02 11:10:34 +02:00
v21.go [FEAT] Allow pushmirror to use publickey authentication 2024-08-22 17:05:07 +02:00
v22.go [FEAT] Add support for webauthn credential level 3 2024-08-29 10:05:03 +02:00
v23.go Add branch auto deletion for scheduled PRs 2024-10-31 03:49:15 +01:00
v24.go fix: extend forgejo_auth_token table (part two) 2024-11-16 10:53:46 +01:00
v25.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v25_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v26.go fix: match PackageBlob.HashBlake2b definition and migration (#7543) 2025-04-15 07:05:21 +00:00
v27.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
v28.go fix: forgejo migrations numbering in comments and rename latest migration file (#6957) 2025-02-16 08:17:33 +00:00
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 fix: maven use groupId:artifactId for package name concatenation (#6352) 2025-06-01 09:02:29 +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