update db

This commit is contained in:
Dot-Rar 2019-11-30 16:09:27 +00:00
parent 617ee1574e
commit f85b043c27
2 changed files with 6 additions and 1 deletions

View File

@ -28,5 +28,8 @@ func ConnectToDatabase() {
db.DB().SetMaxOpenConns(config.Conf.MariaDB.Threads)
db.DB().SetMaxIdleConns(0)
db.Set("gorm:table_options", "charset=utf8mb4")
db.BlockGlobalUpdate(true)
Database = *db
}

View File

@ -25,7 +25,9 @@ func AddBlacklist(guildId, userId int64) {
}
func RemoveBlacklist(guildId, userId int64) {
database.Database.Delete(&BlacklistNode{Guild: guildId, User: userId})
var node BlacklistNode
database.Database.Where(BlacklistNode{Guild: guildId, User: userId}).Take(&node)
database.Database.Delete(&node)
}
func GetBlacklistNodes(guildId int64) []BlacklistNode {