From 6e92feaba23a4992e0ec4b529660921a6bcb492a Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sun, 8 Mar 2026 18:51:05 +0100 Subject: feat(config): leave gorm --- user/member.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'user/member.go') 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 -- cgit v1.2.3