diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-08 11:19:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 03:19:35 +0000 |
commit | 29a8c8de779924694fadad80b31cc855dd62c0f2 (patch) | |
tree | 35ab4131831ee31556c5afc66c2ee56f44c80fa2 /models | |
parent | 26653b196bd1d15c532af41f60351596dd4330bd (diff) | |
download | gitea-29a8c8de779924694fadad80b31cc855dd62c0f2.tar.gz gitea-29a8c8de779924694fadad80b31cc855dd62c0f2.zip |
Partially enable MSSQL case-sensitive collation support (#29238)
Follow #28662
Diffstat (limited to 'models')
-rw-r--r-- | models/db/collation.go | 3 | ||||
-rw-r--r-- | models/project/board.go | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/models/db/collation.go b/models/db/collation.go index 2f5ff2bf05..c128cf5029 100644 --- a/models/db/collation.go +++ b/models/db/collation.go @@ -166,8 +166,7 @@ func preprocessDatabaseCollation(x *xorm.Engine) { // try to alter database collation to expected if the database is empty, it might fail in some cases (and it isn't necessary to succeed) // at the moment, there is no "altering" solution for MSSQL, site admin should manually change the database collation - // and there is a bug https://github.com/go-testfixtures/testfixtures/pull/182 mssql: Invalid object name 'information_schema.tables'. - if !r.CollationEquals(r.DatabaseCollation, r.ExpectedCollation) && r.ExistingTableNumber == 0 && x.Dialect().URI().DBType == schemas.MYSQL { + if !r.CollationEquals(r.DatabaseCollation, r.ExpectedCollation) && r.ExistingTableNumber == 0 { if err = alterDatabaseCollation(x, r.ExpectedCollation); err != nil { log.Error("Failed to change database collation to %q: %v", r.ExpectedCollation, err) } else { diff --git a/models/project/board.go b/models/project/board.go index 3e2d8e0472..c0e6529880 100644 --- a/models/project/board.go +++ b/models/project/board.go @@ -232,7 +232,7 @@ func UpdateBoard(ctx context.Context, board *Board) error { func (p *Project) GetBoards(ctx context.Context) (BoardList, error) { boards := make([]*Board, 0, 5) - if err := db.GetEngine(ctx).Where("project_id=? AND `default`=?", p.ID, false).OrderBy("Sorting").Find(&boards); err != nil { + if err := db.GetEngine(ctx).Where("project_id=? AND `default`=?", p.ID, false).OrderBy("sorting").Find(&boards); err != nil { return nil, err } |