-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the webauthn_credential_id_sequence in Postgres #19048
Update the webauthn_credential_id_sequence in Postgres #19048
Conversation
There is (yet) another problem with v210 in that Postgres will silently allow preset ID insertions ... but it will not update the sequence value. This PR simply adds a little step to the end of the v210 migration to update the sequence number. Users who have already migrated who find that they cannot insert new webauthn_credentials into the DB can either run: ```bash gitea doctor recreate-table webauthn_credential ``` or ```bash ./gitea doctor --run=check-db-consistency --fix ``` which will fix the bad sequence. Fix go-gitea#19012 Signed-off-by: Andrew Thornton <art27@cantab.net>
An alternative option is to add yet another migration v211 which will simply run the alter sequence command then we can drop the rest of the warning and make it automatic.
This is a low risk problem and should cause no issues but it is one worth considering. |
Signed-off-by: Andrew Thornton <art27@cantab.net>
🚀 |
* giteaofficial/main: Prevent 500 when there is an error during new auth source post (go-gitea#19041) Update the webauthn_credential_id_sequence in Postgres (go-gitea#19048) If rendering has failed due to a net.OpError stop rendering (attempt 2) (go-gitea#19049) use xorm builder for models.getReviewers() (go-gitea#19033) RSS/Atom support for Orgs (go-gitea#17714) Fix flag validation (go-gitea#19046) Improve SyncMirrors logging (go-gitea#19045)
Backport go-gitea#19048 There is (yet) another problem with v210 in that Postgres will silently allow preset ID insertions ... but it will not update the sequence value. This PR simply adds a little step to the end of the v210 migration to update the sequence number. Users who have already migrated who find that they cannot insert new webauthn_credentials into the DB can either run: ```bash gitea doctor recreate-table webauthn_credential ``` or ```bash SELECT setval('webauthn_credential_id_seq', COALESCE((SELECT MAX(id)+1 FROM `webauthn_credential`), 1), false) ``` which will fix the bad sequence. Fix go-gitea#19012 Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport #19048 There is (yet) another problem with v210 in that Postgres will silently allow preset ID insertions ... but it will not update the sequence value. This PR simply adds a little step to the end of the v210 migration to update the sequence number. Users who have already migrated who find that they cannot insert new webauthn_credentials into the DB can either run: ```bash gitea doctor recreate-table webauthn_credential ``` or ```bash SELECT setval('webauthn_credential_id_seq', COALESCE((SELECT MAX(id)+1 FROM `webauthn_credential`), 1), false) ``` which will fix the bad sequence. Fix #19012 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Update the webauthn_credential_id_sequence in Postgres There is (yet) another problem with v210 in that Postgres will silently allow preset ID insertions ... but it will not update the sequence value. This PR simply adds a little step to the end of the v210 migration to update the sequence number. Users who have already migrated who find that they cannot insert new webauthn_credentials into the DB can either run: ```bash gitea doctor recreate-table webauthn_credential ``` or ```bash ./gitea doctor --run=check-db-consistency --fix ``` which will fix the bad sequence. Fix go-gitea#19012 Signed-off-by: Andrew Thornton <art27@cantab.net>
There is (yet) another problem with v210 in that Postgres will silently allow preset
ID insertions ... but it will not update the sequence value.
This PR simply adds a little step to the end of the v210 migration to update the
sequence number.
Users who have already migrated who find that they cannot insert new
webauthn_credentials into the DB can either run:
or in postgres run:
which will fix the bad sequence.
Fix #19012
Signed-off-by: Andrew Thornton art27@cantab.net