aboutsummaryrefslogtreecommitdiff
path: root/user/member.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-03-08 18:51:05 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2026-03-08 18:51:05 +0100
commit6e92feaba23a4992e0ec4b529660921a6bcb492a (patch)
tree05024b52d4c8ede041facdc48ac65af5ba0259da /user/member.go
parent3bcf74c47d1597ba650dc5a55868f83f5f547ad7 (diff)
feat(config): leave gorm
Diffstat (limited to 'user/member.go')
-rw-r--r--user/member.go9
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