-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Migrate failure 1.19.3 => 1.20.0: Change Container Metadata failed #25918
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
Labels
issue/critical
This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP
topic/packages
type/bug
Comments
@lunny Could xorm prevent this? gitea/models/migrations/v1_20/v250.go Line 129 in d032500
|
KN4CK3R
added a commit
that referenced
this issue
Jul 28, 2023
Fixes #25918 The migration fails on MSSQL because xorm tries to update the primary key column. xorm prevents this if the column is marked as auto increment: https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40 I think it would be better if xorm would check for primary key columns here because updating such columns is bad practice. It looks like if that auto increment check should do the same. fyi @lunny
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this issue
Jul 28, 2023
Fixes go-gitea#25918 The migration fails on MSSQL because xorm tries to update the primary key column. xorm prevents this if the column is marked as auto increment: https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40 I think it would be better if xorm would check for primary key columns here because updating such columns is bad practice. It looks like if that auto increment check should do the same. fyi @lunny
KN4CK3R
added a commit
that referenced
this issue
Jul 28, 2023
Backport #26192 by @KN4CK3R Fixes #25918 The migration fails on MSSQL because xorm tries to update the primary key column. xorm prevents this if the column is marked as auto increment: https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40 I think it would be better if xorm would check for primary key columns here because updating such columns is bad practice. It looks like if that auto increment check should do the same. fyi @lunny Co-authored-by: KN4CK3R <[email protected]>
project-mirrors-bot-tu bot
pushed a commit
to project-mirrors/forgejo-as-gitea-fork
that referenced
this issue
Jan 23, 2025
) Backport go-gitea#26192 by @KN4CK3R Fixes go-gitea#25918 The migration fails on MSSQL because xorm tries to update the primary key column. xorm prevents this if the column is marked as auto increment: https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40 I think it would be better if xorm would check for primary key columns here because updating such columns is bad practice. It looks like if that auto increment check should do the same. fyi @lunny Co-authored-by: KN4CK3R <[email protected]> (cherry picked from commit ecfbcce)
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
topic/packages
type/bug
Description
After replacing the binary, the service does not start.
The following lines could be found in gitea.log:
"Die id-Identitätsspalte kann nicht aktualisiert werden." => The id-column cannot be updated.
I think the error roots in this file: https://github.com/go-gitea/gitea/blob/release/v1.20/models/migrations/v1_20/v250.go
The sql that is sent to the database is
If I remove the identity from the ID column, the migration succeeds, and Gitea starts successfully.
Gitea Version
1.20.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
git version 2.17.1
Operating System
ubuntu 18.04
How are you running Gitea?
I run
gitea-1.20.0-linux-amd64
with systemd. MSSQL 14.0.3460.9 (SQL Server 2017)Database
MSSQL
The text was updated successfully, but these errors were encountered: