Skip to content

Commit

Permalink
fix: use string for uint64 database fields
Browse files Browse the repository at this point in the history
Neither database/sql or sqlite in general can handle values larger than
int64, so we use a string type to store them in the database
  • Loading branch information
agaffney committed Nov 17, 2024
1 parent 807ad7f commit d3af62c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions state/models/pool_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ type PoolRegistration struct {
ID uint `gorm:"primarykey"`
PoolKeyHash []byte `gorm:"index"`
VrfKeyHash []byte
Pledge uint64
Cost uint64
Pledge uint64 `gorm:"type:string"`
Cost uint64 `gorm:"type:string"`
Margin *database.Rat
Owners []PoolRegistrationOwner
Relays []PoolRegistrationRelay
Expand Down

0 comments on commit d3af62c

Please sign in to comment.