-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update the webauthn_credential_id_sequence in Postgres #19048
Merged
6543
merged 4 commits into
go-gitea:main
from
zeripath:fix-v210-again-postgres-sequence
Mar 10, 2022
Merged
Update the webauthn_credential_id_sequence in Postgres #19048
6543
merged 4 commits into
go-gitea:main
from
zeripath:fix-v210-again-postgres-sequence
Mar 10, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
6543
approved these changes
Mar 10, 2022
Gusted
approved these changes
Mar 10, 2022
🚀 |
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 11, 2022
* 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)
zeripath
added a commit
to zeripath/gitea
that referenced
this pull request
Mar 11, 2022
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>
lunny
pushed a commit
that referenced
this pull request
Mar 13, 2022
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>
Chianina
pushed a commit
to Chianina/gitea
that referenced
this pull request
Mar 28, 2022
* 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>
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Labels
backport/done
All backports for this PR have been created
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
type/bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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