mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-06 19:08:57 +09:00
ac49dbe1a2
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
30 lines
672 B
Go
30 lines
672 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_25
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dev/modelmigration/base"
|
|
|
|
"xorm.io/xorm/schemas"
|
|
)
|
|
|
|
func ExtendCommentTreePathLength(ctx context.Context, x base.EngineMigration) error {
|
|
dbType := x.Dialect().URI().DBType
|
|
if dbType == schemas.SQLITE { // For SQLITE, varchar or char will always be represented as TEXT
|
|
return nil
|
|
}
|
|
|
|
return base.ModifyColumn(ctx, x, "comment", &schemas.Column{
|
|
Name: "tree_path",
|
|
SQLType: schemas.SQLType{
|
|
Name: "VARCHAR",
|
|
},
|
|
Length: 4000,
|
|
Nullable: true, // To keep compatible as nullable
|
|
DefaultIsEmpty: true,
|
|
})
|
|
}
|