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

1.22 to 1.23 migration issue: wrong index name #33724

Closed
wismna opened this issue Feb 25, 2025 · 2 comments
Closed

1.22 to 1.23 migration issue: wrong index name #33724

wismna opened this issue Feb 25, 2025 · 2 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@wismna
Copy link

wismna commented Feb 25, 2025

Description

Hi,

I'm trying to upgrade gitea from version 1.22 to 1.23, but the migration process fails on that line of migrations.go:
newMigration(299, "Add content version to issue and comment table", v1_23.AddContentVersionToIssueAndComment),

Here are the logs:
2025/02/25 16:26:17 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #10/10... 2025/02/25 16:26:17 cmd/web.go:205:serveInstalled() [I] PING DATABASE sqlite3 2025/02/25 16:26:17 routers/common/db.go:31:InitDBEngine() [W] Table version column id db type is , struct type is INTEGER 2025/02/25 16:26:17 routers/common/db.go:31:InitDBEngine() [W] Table version Column id db nullable is true, struct nullable is false 2025/02/25 16:26:17 routers/common/db.go:31:InitDBEngine() [W] Table version column version db type is , struct type is INTEGER 2025/02/25 16:26:17 ...ations/migrations.go:494:Migrate() [I] Migration[299]: Add content version to issue and comment table 2025/02/25 16:26:17 routers/init.go:74:mustInitCtx() [F] code.gitea.io/gitea/routers/common.InitDBEngine(ctx) failed: migrate: migration[299]: Add content version to issue and comment table failed: no such index: **IDX_comment_idx_comment_issue_id**

Seems like it's looking for an index that doesn't exist, as I think it should be looking for idx_comment_issue_id instead (that does exist in my DB, I checked).

I couldn't find any information on that strange behavior, any ideas ?

Gitea Version

1.22

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

DSM 7

How are you running Gitea?

It runs on my Synology NAS. I tried:

  • the available package from synocommunity
  • the official docker container

Database

SQLite

@lunny
Copy link
Member

lunny commented Feb 25, 2025

It should be IDX_comment_issue_id, maybe because your index is idx_comment_issue_id for some reasons. Could you try rename the index manually and try upgrade again.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Feb 25, 2025
@wismna
Copy link
Author

wismna commented Feb 26, 2025

Yep, that was it. I renamed them and it fixed the issue. Thanks !

@wismna wismna closed this as completed Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

No branches or pull requests

2 participants