The tests on migration tests failed but CI reports successfully
https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141
This PR will fix the bug on migration v283 and also the CI hidden
behaviour.
The reason is on the Makefile
`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.
But
`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
done`
will not work.
This also fix#29602
if_,err:=x.Exec("delete from issue_user where id in (SELECT id FROM issue_user WHERE issue_id = ? and uid = ? limit ?)",issueUser.IssueID,issueUser.UID,issueUser.Cnt-1);err!=nil{
returnerr
ifx.Dialect().URI().DBType==schemas.MSSQL{
if_,err:=x.Exec(fmt.Sprintf("delete from issue_user where id in (SELECT top %d id FROM issue_user WHERE issue_id = ? and uid = ?)",issueUser.Cnt-1),issueUser.IssueID,issueUser.UID);err!=nil{
returnerr
}
}else{
varids[]int64
iferr:=x.SQL("SELECT id FROM issue_user WHERE issue_id = ? and uid = ? limit ?",issueUser.IssueID,issueUser.UID,issueUser.Cnt-1).Find(&ids);err!=nil{