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>
This commit is contained in:
Earl Warren 2025-04-15 07:05:21 +00:00 committed by Earl Warren
parent 6d703bb6e3
commit 1b11ca6f36

View file

@ -8,7 +8,7 @@ import "xorm.io/xorm"
func AddHashBlake2bToPackageBlob(x *xorm.Engine) error {
type PackageBlob struct {
ID int64 `xorm:"pk autoincr"`
HashBlake2b string
HashBlake2b string `xorm:"hash_blake2b char(128) UNIQUE(blake2b) INDEX"`
}
return x.Sync(&PackageBlob{})
}