forgejo/models/forgejo_migrations/v26.go
Earl Warren 1b11ca6f36 fix: match PackageBlob.HashBlake2b definition and migration (#7543)
If not a migration will show a warning:

`[W] Table public.package_blob column hash_blake2b db type is VARCHAR(255), struct type is CHAR(128)`

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7543
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-15 07:05:21 +00:00

14 lines
397 B
Go

// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgejo_migrations //nolint:revive
import "xorm.io/xorm"
func AddHashBlake2bToPackageBlob(x *xorm.Engine) error {
type PackageBlob struct {
ID int64 `xorm:"pk autoincr"`
HashBlake2b string `xorm:"hash_blake2b char(128) UNIQUE(blake2b) INDEX"`
}
return x.Sync(&PackageBlob{})
}