mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 14:31:02 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			397 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			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{})
 | |
| }
 |