Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
i2_bot/lib/migrations/10_update_leagues.go

39 lines
993 B
Go
Raw Normal View History

2017-10-11 06:53:50 +04:00
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017-2018 Vladimir "fat0troll" Hodakov
2017-10-11 06:53:50 +04:00
package migrations
import (
2017-10-18 07:03:34 +04:00
"database/sql"
2017-10-11 06:53:50 +04:00
)
2017-11-14 03:44:21 +04:00
// UpdateLeaguesUp fixes some fuckup with leagues' emoji
2017-10-11 06:53:50 +04:00
func UpdateLeaguesUp(tx *sql.Tx) error {
_, err := tx.Exec("UPDATE `leagues` SET symbol='🈸' WHERE symbol=':u7533:'")
2017-10-18 07:03:34 +04:00
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol='🈳 ' WHERE symbol=':u6e80'")
2017-10-18 07:03:34 +04:00
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol='🈵' WHERE symbol=':u7a7a:'")
2017-10-11 06:53:50 +04:00
return err
2017-10-11 06:53:50 +04:00
}
2017-11-14 03:44:21 +04:00
// UpdateLeaguesDown returns leagues emoji fuckup for sanity purposes
2017-10-11 06:53:50 +04:00
func UpdateLeaguesDown(tx *sql.Tx) error {
_, err := tx.Exec("UPDATE `leagues` SET symbol=':u7533:' WHERE symbol='🈸'")
2017-10-18 07:03:34 +04:00
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol=':u6e80' WHERE symbol='🈳 '")
2017-10-18 07:03:34 +04:00
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol=':u7a7a:' WHERE symbol='🈵'")
2017-10-11 06:53:50 +04:00
return err
2017-10-11 06:53:50 +04:00
}