Skip to content

Database migration fails when attempting to upgrade from version 1.20.5 #28247

Closed
@snoopydo

Description

@snoopydo

Description

When attempting to upgrade from version 1.20.5 (windows gogit x64), the migrations fail and service stops.
In the log there are 10x

2023/11/28 13:13:58 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: get: mssql: Invalid usage of the option NEXT in the FETCH statement.

enabling logsql and verbose logging i see

2023/11/28 13:29:55 [email protected]/engine.go:1246:Get() [I] [SQL] SELECT [id], [version] FROM [version] WHERE [id]=? ORDER BY [id] ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY [1]

That syntax isn't supported by MSSQL until version 2012 at least. Documentation says 2008 R2 SP3 is supported.

Gitea Version

windows gogit x64 1.20.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.42.0.windows.2

Operating System

Windows Server 2012

How are you running Gitea?

Running as a service, using prebuilt binaries downloaded from releases tab from github

Database

MSSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions