-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add unique constraint back into issue_index #16938
Merged
lunny
merged 1 commit into
go-gitea:release/v1.15
from
zeripath:fix-16936-dont-get-rid-of-the-unique
Sep 3, 2021
Merged
Add unique constraint back into issue_index #16938
lunny
merged 1 commit into
go-gitea:release/v1.15
from
zeripath:fix-16936-dont-get-rid-of-the-unique
Sep 3, 2021
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 a flaw in go-gitea#16820 where it was missed that although xorm will not add a primary key to a table during syncing, it will remove an unique constraint. Users upgrading from 1.15.0 to 1.15.1 will therefore lose the unique constraint that makes this table work unless they run `gitea doctor recreate-table issue_index`. Postgres helpfully warns about this situation but MySQL does not. Main/1.16-dev is not affected by this issue as there is a migration that does the above recreation by default. Users moving directly to 1.15.1 from 1.14.x or lower are also not affected. Whilst we could force all users who ran 1.15.0 to do the above recreate-table call, this PR proposes an alternative: Just add the unique constraint back in for 1.15.x. This won't have any long term effects - just some wasted space for the unnecessary index. Fix go-gitea#16936 Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath
added
type/bug
issue/critical
This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP
labels
Sep 3, 2021
KN4CK3R
approved these changes
Sep 3, 2021
GiteaBot
added
the
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
label
Sep 3, 2021
axifive
approved these changes
Sep 3, 2021
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Sep 3, 2021
zeripath
added a commit
to zeripath/gitea
that referenced
this pull request
Sep 3, 2021
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03 * BUGFIXES * Add unique constraint back into issue_index (go-gitea#16938) Signed-off-by: Andrew Thornton <art27@cantab.net>
Merged
6 tasks
zeripath
added a commit
that referenced
this pull request
Sep 3, 2021
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03 * BUGFIXES * Add unique constraint back into issue_index (#16938) * Close storage objects before cleaning (#16934) (#16942) Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath
added a commit
to zeripath/gitea
that referenced
this pull request
Sep 3, 2021
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03 * BUGFIXES * Add unique constraint back into issue_index (go-gitea#16938) * Close storage objects before cleaning (go-gitea#16934) (go-gitea#16942) Signed-off-by: Andrew Thornton <art27@cantab.net>
lunny
pushed a commit
that referenced
this pull request
Sep 3, 2021
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03 * BUGFIXES * Add unique constraint back into issue_index (#16938) * Close storage objects before cleaning (#16934) (#16942) Signed-off-by: Andrew Thornton <art27@cantab.net>
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
issue/critical
This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP
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 a flaw in #16820 where it was missed that although xorm will
not add a primary key to a table during syncing, it will remove an
unique constraint.
Users upgrading from 1.15.0 to 1.15.1 will therefore lose the unique
constraint that makes this table work unless they run
gitea doctor recreate-table issue_index
. Postgres helpfully warns about thissituation but MySQL does not.
Main/1.16-dev is not affected by this issue as there is a migration that
does the above recreation by default. Users moving directly to 1.15.1
from 1.14.x or lower are also not affected.
Whilst we could force all users who ran 1.15.0 to do the above
recreate-table call, this PR proposes an alternative: Just add the
unique constraint back in for 1.15.x. This won't have any long term
effects - just some wasted space for the unnecessary index.
Fix #16936
Signed-off-by: Andrew Thornton art27@cantab.net