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:
silverwind
2026-04-27 12:08:29 +02:00
committed by beardev-in
parent 795c6bc944
commit 45832f4d68
12 changed files with 229 additions and 105 deletions

View 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,
})
}