Pokememes possibilities, some refactoring
This commit is contained in:
27
lib/migrations/14_fix_time_element.go
Normal file
27
lib/migrations/14_fix_time_element.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// i2_bot – Instinct PokememBro Bot
|
||||
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
// stdlib
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
func FixTimeElementUp(tx *sql.Tx) error {
|
||||
_, err := tx.Exec("UPDATE `elements` SET league_id=3 WHERE symbol='⌛';")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func FixTimeElementDown(tx *sql.Tx) error {
|
||||
_, err := tx.Exec("UPDATE `elements` SET league_id=1 WHERE symbol='⌛';")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@@ -28,6 +28,7 @@ func (m *Migrations) Init() {
|
||||
goose.AddNamedMigration("11_profile_data_additions.go", ProfileDataAdditionsUp, ProfileDataAdditionsDown)
|
||||
goose.AddNamedMigration("12_create_profile_relations.go", CreateProfileRelationsUp, CreateProfileRelationsDown)
|
||||
goose.AddNamedMigration("13_create_weapons_and_add_wealth.go", CreateWeaponsAndAddWealthUp, CreateWeaponsAndAddWealthDown)
|
||||
goose.AddNamedMigration("14_fix_time_element.go", FixTimeElementUp, FixTimeElementDown)
|
||||
}
|
||||
|
||||
func (m *Migrations) Migrate() error {
|
||||
|
Reference in New Issue
Block a user