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

45 lines
1.0 KiB
Go
Raw Normal View History

2017-10-11 06:53:50 +04:00
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
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 {
2017-10-18 07:03:34 +04:00
_, err := tx.Exec("UPDATE `leagues` SET symbol='🈸' WHERE symbol=':u7533:';")
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol='🈳 ' WHERE symbol=':u6e80';")
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol='🈵' WHERE symbol=':u7a7a:';")
if err != nil {
return err
}
2017-10-11 06:53:50 +04:00
2017-10-18 07:03:34 +04:00
return nil
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 {
2017-10-18 07:03:34 +04:00
_, err := tx.Exec("UPDATE `leagues` SET symbol=':u7533:' WHERE symbol='🈸';")
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol=':u6e80' WHERE symbol='🈳 ';")
if err != nil {
return err
}
_, err = tx.Exec("UPDATE `leagues` SET symbol=':u7a7a:' WHERE symbol='🈵';")
if err != nil {
return err
}
2017-10-11 06:53:50 +04:00
2017-10-18 07:03:34 +04:00
return nil
2017-10-11 06:53:50 +04:00
}