File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 11package postgres
22
33import (
4- "database/sql/driver"
5- "encoding/json"
64 "time"
75
8- "github.com/pkg/errors"
9-
106 "gorm.io/gorm"
117)
128
@@ -65,7 +61,7 @@ type Mod struct {
6561 LastVersionDate * time.Time
6662 ModReference string
6763 Hidden bool
68- Compatibility * CompatibilityInfo
64+ Compatibility * CompatibilityInfo `gorm:"serializer:json"`
6965
7066 Users []User `gorm:"many2many:user_mods;"`
7167
@@ -187,17 +183,6 @@ type CompatibilityInfo struct {
187183 EXP Compatibility `gorm:"type:compatibility"`
188184}
189185
190- func (c * CompatibilityInfo ) Value () (driver.Value , error ) {
191- b , err := json .Marshal (c )
192- return b , errors .Wrap (err , "failed to marshal" )
193- }
194-
195- func (c * CompatibilityInfo ) Scan (src any ) error {
196- v := src .([]byte )
197- err := json .Unmarshal (v , c )
198- return errors .Wrap (err , "failed to unmarshal" )
199- }
200-
201186type Compatibility struct {
202187 State string
203188 Note string
You can’t perform that action at this time.
0 commit comments