Skip to content
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

Fix database keyword quote problem on migration v161 #17522

Merged
merged 5 commits into from
Nov 4, 2021

Conversation

lunny
Copy link
Member

@lunny lunny commented Nov 2, 2021

type is a keyword of some database, i.e. mysql.

ations/migrations.go:394:Migrate() [I] Migration[161]: Convert task type from int to string
...
[E] ORM engine initialization attempt #4/10 failed. Error: migrate: do migrate: Error 1054: Unknown column 'type' in 'where clause'
	/source/routers/init.go:81 (0x2056486)
	/source/routers/init.go:154 (0x2057035)
	/source/cmd/web.go:128 (0x22eae97)
	/source/vendor/github.com/urfave/cli/app.go:524 (0x1b8e064)
	/source/vendor/github.com/urfave/cli/command.go:173 (0x1b8edd8)
	/source/vendor/github.com/urfave/cli/app.go:277 (0x1b8c0a7)
	/source/main.go:115 (0x2326269)
	/usr/local/go/src/runtime/proc.go:225 (0x443135)
	/usr/local/go/src/runtime/asm_amd64.s:1371 (0x47a880)

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Nov 2, 2021
@zeripath
Copy link
Contributor

zeripath commented Nov 2, 2021

weird that the generic migration test didn't pick this one up.

I guess this should be a wake up that we do need to create migration tests for any migration that is more than simply xorm.Sync().

@GiteaBot 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 Nov 2, 2021
@lafriks lafriks merged commit fed8e01 into go-gitea:main Nov 4, 2021
@lunny lunny deleted the lunny/fix_db_keyword branch November 5, 2021 02:48
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* support rerun migration v161

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants