Address remaining review feedback
- Use ParseIssueFilterStateIsClosed for ListProjects state parsing - Add SortTypeProjectColumnSorting const, replace magic string - Use GetIssueByRepoID and dedupe Add/Remove issue handlers - Migrate Column.Sorting from int8 to int (drops 127-column limit, allows the API to expose a normal int without truncation) - Introduce project_service.UpdateProject with optional.Option fields, use it from the API EditProject handler Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
26
models/migrations/v1_27/v332.go
Normal file
26
models/migrations/v1_27/v332.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_27
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
// WidenProjectBoardSorting changes project_board.sorting from int8 (TINYINT) to int (INTEGER)
|
||||
// so the public API can expose a regular int and lift the 127 column upper bound.
|
||||
func WidenProjectBoardSorting(x *xorm.Engine) error {
|
||||
if x.Dialect().URI().DBType == schemas.SQLITE {
|
||||
return nil
|
||||
}
|
||||
return base.ModifyColumn(x, "project_board", &schemas.Column{
|
||||
Name: "sorting",
|
||||
SQLType: schemas.SQLType{Name: "INT"},
|
||||
Nullable: false,
|
||||
Default: "0",
|
||||
DefaultIsEmpty: false,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user