forgejo/models/forgejo_migrations
Earl Warren 83e186c00c fix: discard v25 secrets migrations errors instead of failing (#7251)
Failing the migration when a corrupted record is found is problematic because there is no transaction and the database may need to be restored from a backup to attempt the migration again, after deleting the corrupted records.

Each documented case of failed migration was resolved by removing the corrupted records. There is no instance of a failed migration that was caused by non corrupted record.

In the unlikely event of a false negative where a two_factor record is discarded although it is in use, the only consequence is that the user will have to enroll again. Detailed logs are displayed so the Forgejo admin can file a bug report if that happens.

Refs: https://codeberg.org/forgejo/forgejo/issues/6637

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7251): <!--number 7251 --><!--line 0 --><!--description V2hlbiBtaWdyYXRpbmcgdG8gRm9yZ2VqbyB2MTAsIHRoZSBUT1RQIHNlY3JldHMgZm91bmQgdG8gYmUgY29ycnVwdGVkIGFyZSBub3cgdHJhbnNwYXJlbnRseSByZW1vdmVkIGZyb20gdGhlIGRhdGFiYXNlIGluc3RlYWQgb2YgZmFpbGluZyB0aGUgbWlncmF0aW9uLiBUT1RQIGlzIG5vIGxvbmdlciByZXF1aXJlZCB0byBsb2dpbiB3aXRoIHRoZSBhc3NvY2lhdGVkIHVzZXJzLiBUaGV5IHNob3VsZCBiZSBpbmZvcm1lZCBiZWNhdXNlIHRoZXkgd2lsbCBuZWVkIHRvIHZpc2l0IHRoZWlyIHNlY3VyaXR5IHNldHRpbmdzIGFuZCBjb25maWd1cmUgVE9UUCBhZ2Fpbi4gTm8gb3RoZXIgYWN0aW9uIGlzIHJlcXVpcmVkLg==-->When migrating to Forgejo v10, the TOTP secrets found to be corrupted are now transparently removed from the database instead of failing the migration. TOTP is no longer required to login with the associated users. They should be informed because they will need to visit their security settings and configure TOTP again. No other action is required.<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7251
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-03-17 16:25:37 +00:00
..
v1_20 [SECURITY] Rework long-term authentication 2024-02-05 15:06:15 +01:00
v1_22 Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
main_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
migrate.go fix: forgejo migrations numbering in comments and rename latest migration file (#6957) 2025-02-16 08:17:33 +00:00
migrate_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
v13.go [FEAT]Add Option to hide Release Archive links (#3139) 2024-04-24 15:15:55 +00:00
v14.go Drop Gitea-specific columns from two tables 2024-04-26 10:34:06 +02:00
v15.go enhance test & fix reviews 2024-05-14 08:24:31 +02: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 fix: discard v25 secrets migrations errors instead of failing (#7251) 2025-03-17 16:25:37 +00:00
v25_test.go fix: discard v25 secrets migrations errors instead of failing (#7251) 2025-03-17 16:25:37 +00:00
v26.go Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00
v27.go feat: add configurable cooldown to claim usernames (#6422) 2025-01-24 04:16:56 +00:00
v28.go fix: forgejo migrations numbering in comments and rename latest migration file (#6957) 2025-02-16 08:17:33 +00:00