Files
hearth/package/gitea/source/models/migrations/v1_16/v205.go
T
yukkop d9b2a4e787
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s
feat: update gitea vendor
2026-09-26 21:18:24 +00:00

43 lines
846 B
Go

// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package v1_16
import (
"gitea.dev/models/db"
"gitea.dev/models/migrations/base"
"xorm.io/xorm/schemas"
)
func MigrateUserPasswordSalt(x db.EngineMigration) error {
dbType := x.Dialect().URI().DBType
// For SQLITE, the max length doesn't matter.
if dbType == schemas.SQLITE {
return nil
}
if err := base.ModifyColumn(x, "user", &schemas.Column{
Name: "rands",
SQLType: schemas.SQLType{
Name: "VARCHAR",
},
Length: 32,
// MySQL will like us again.
Nullable: true,
DefaultIsEmpty: true,
}); err != nil {
return err
}
return base.ModifyColumn(x, "user", &schemas.Column{
Name: "salt",
SQLType: schemas.SQLType{
Name: "VARCHAR",
},
Length: 32,
Nullable: true,
DefaultIsEmpty: true,
})
}