diff options
Diffstat (limited to 'user/member.go')
| -rw-r--r-- | user/member.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/user/member.go b/user/member.go index 1e25617..3437be1 100644 --- a/user/member.go +++ b/user/member.go @@ -11,15 +11,15 @@ import ( type Copaing struct { ID uint64 - CopaingXPs []CopaingXP `gorm:"constraint:OnDelete:SET NULL;"` - GuildID uint64 `gorm:"not null"` + CopaingXPs []CopaingXP + GuildID uint64 lastSaved int } type CopaingXP struct { - XP uint `gorm:"default:0"` + XP uint CopaingID uint64 - GuildID uint64 `gorm:"not null;"` + GuildID uint64 CreatedAt time.Time } @@ -67,6 +67,7 @@ func (c *Copaing) load(ctx context.Context) error { `SELECT xp, created_at FROM copaing_xps WHERE copaing_id = ? AND guild_id = ?`, c.ID, c.GuildID, ) + defer rows.Close() if err != nil { if !errors.Is(err, sql.ErrNoRows) { return err |
