diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-08 13:38:10 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-03-08 13:38:10 +0100 |
| commit | ddd6306752186c149f8ad3bf2f59b5428cf01296 (patch) | |
| tree | 0e40562ef636a9a76cc298e8695cc04abbdcfda5 /config | |
| parent | 88e1b886e5471552c055374f71d848d3a3dcb4b6 (diff) | |
feat(db): run migrations
Diffstat (limited to 'config')
| -rw-r--r-- | config/guild.go | 5 | ||||
| -rw-r--r-- | config/xp_role.go | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/config/guild.go b/config/guild.go index bcebd65..dc8251f 100644 --- a/config/guild.go +++ b/config/guild.go @@ -5,7 +5,6 @@ import ( "fmt" "strings" - "git.anhgelus.world/anhgelus/les-copaings-bot/common" "github.com/nyttikord/gokord/bot" "github.com/nyttikord/gokord/channel" ) @@ -47,11 +46,11 @@ func GetGuildConfig(ctx context.Context, guildID uint64) *Guild { } func (cfg *Guild) Load(ctx context.Context) error { - return common.GetDB(ctx).Where("guild_id = ?", cfg.GuildID).Preload("XpRoles").FirstOrCreate(cfg).Error + return nil //common.GetDB(ctx).Where("guild_id = ?", cfg.GuildID).Preload("XpRoles").FirstOrCreate(cfg).Error } func (cfg *Guild) Save(ctx context.Context) error { - return common.GetDB(ctx).Save(cfg).Error + return nil //common.GetDB(ctx).Save(cfg).Error } func (cfg *Guild) IsDisabled(ctx context.Context, dg bot.Session, channelID uint64) bool { diff --git a/config/xp_role.go b/config/xp_role.go index 6592ac9..81082e8 100644 --- a/config/xp_role.go +++ b/config/xp_role.go @@ -6,7 +6,6 @@ import ( "slices" "strconv" - "git.anhgelus.world/anhgelus/les-copaings-bot/common" "git.anhgelus.world/anhgelus/les-copaings-bot/dynamicid" "git.anhgelus.world/anhgelus/les-copaings-bot/exp" "github.com/nyttikord/gokord/bot" @@ -210,7 +209,7 @@ func HandleXpRoleEditRole(ctx context.Context, dg bot.Session, i *interaction.Me return } xpRole.RoleID = role - err = common.GetDB(ctx).Save(xpRole).Error + err = nil // common.GetDB(ctx).Save(xpRole).Error if err != nil { bot.Logger(ctx).Error("saving config", "error", err, "guild", i.GuildID, "id", id, "type", "add") } @@ -295,7 +294,7 @@ func HandleXpRoleEditLevel(ctx context.Context, dg bot.Session, i *interaction.M return } xpRole.XP = xp - err = common.GetDB(ctx).Save(xpRole).Error + err = nil //common.GetDB(ctx).Save(xpRole).Error if err != nil { bot.Logger(ctx).Error("saving config", "guild", i.GuildID, "id", id, "type", "edit") } @@ -319,7 +318,7 @@ func HandleXpRoleDel(ctx context.Context, dg bot.Session, i *interaction.Message } return } - err := common.GetDB(ctx).Delete(role).Error + var err error = nil //common.GetDB(ctx).Delete(role).Error if err != nil { bot.Logger(ctx).Error("deleting entry", "error", err, "guild", i.GuildID, "id", id, "type", "del") } |
