migrations

package
v0.0.0-...-3723a19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFloodChatIDDown

func AddFloodChatIDDown(tx *sql.Tx) error

AddFloodChatIDDown destroys `flood_chat_id` column

func AddFloodChatIDUp

func AddFloodChatIDUp(tx *sql.Tx) error

AddFloodChatIDUp creates `flood_chat_id` column in `squads` table

func AddIsActiveToPokememesDown

func AddIsActiveToPokememesDown(tx *sql.Tx) error

AddIsActiveToPokememesDown removes `is_active` from `pokememes` table

func AddIsActiveToPokememesUp

func AddIsActiveToPokememesUp(tx *sql.Tx) error

AddIsActiveToPokememesUp adds `is_active` to `pokememes`

func AddKarmaToPlayersDown

func AddKarmaToPlayersDown(tx *sql.Tx) error

AddKarmaToPlayersDown destroys `karma` column

func AddKarmaToPlayersUp

func AddKarmaToPlayersUp(tx *sql.Tx) error

AddKarmaToPlayersUp creates `karma` column in `players` table

func AddNewWeaponDown

func AddNewWeaponDown(tx *sql.Tx) error

AddNewWeaponDown does nothing

func AddNewWeaponUp

func AddNewWeaponUp(tx *sql.Tx) error

AddNewWeaponUp adds new weapon, presented on 26.11.2017

func AddPokememesWealthDown

func AddPokememesWealthDown(tx *sql.Tx) error

AddPokememesWealthDown restores mid-October behaviour

func AddPokememesWealthUp

func AddPokememesWealthUp(tx *sql.Tx) error

AddPokememesWealthUp prepares database for latest game update in mid-October

func AddUserTypeDown

func AddUserTypeDown(tx *sql.Tx) error

AddUserTypeDown destroys `user_type` column

func AddUserTypeUp

func AddUserTypeUp(tx *sql.Tx) error

AddUserTypeUp creates `user_type` column in `squads_players` table

func ChangeChatTypeColumnDown

func ChangeChatTypeColumnDown(tx *sql.Tx) error

ChangeChatTypeColumnDown changes `chat_type` column of `chats` table

func ChangeChatTypeColumnUp

func ChangeChatTypeColumnUp(tx *sql.Tx) error

ChangeChatTypeColumnUp changes `chat_type` column of `chats` table

func ChangeProfilePokememesColumnsDown

func ChangeProfilePokememesColumnsDown(tx *sql.Tx) error

ChangeProfilePokememesColumnsDown restores mid-October behaviour

func ChangeProfilePokememesColumnsUp

func ChangeProfilePokememesColumnsUp(tx *sql.Tx) error

ChangeProfilePokememesColumnsUp prepares database for latest game update in mid-October

func ChangeSquadsTableDown

func ChangeSquadsTableDown(tx *sql.Tx) error

ChangeSquadsTableDown reverts `squads` to old format

func ChangeSquadsTableUp

func ChangeSquadsTableUp(tx *sql.Tx) error

ChangeSquadsTableUp changes `sqauds` to new format

func ChangeTelegramIDColumnDown

func ChangeTelegramIDColumnDown(tx *sql.Tx) error

ChangeTelegramIDColumnDown changes `telegram_id` column of `chats` table

func ChangeTelegramIDColumnUp

func ChangeTelegramIDColumnUp(tx *sql.Tx) error

ChangeTelegramIDColumnUp changes `telegram_id` column of `chats` table

func CreateAlarmsDown

func CreateAlarmsDown(tx *sql.Tx) error

CreateAlarmsDown drops `alarms` table

func CreateAlarmsUp

func CreateAlarmsUp(tx *sql.Tx) error

CreateAlarmsUp creates `alarms` table

func CreateBroadcastsDown

func CreateBroadcastsDown(tx *sql.Tx) error

CreateBroadcastsDown drops `broadcasts` table

func CreateBroadcastsUp

func CreateBroadcastsUp(tx *sql.Tx) error

CreateBroadcastsUp creates `broadcasts` table

func CreateChatsDown

func CreateChatsDown(tx *sql.Tx) error

CreateChatsDown drops `chats` table

func CreateChatsUp

func CreateChatsUp(tx *sql.Tx) error

CreateChatsUp creates `chats` table

func CreateElementsDown

func CreateElementsDown(tx *sql.Tx) error

CreateElementsDown drops `elements` table

func CreateElementsUp

func CreateElementsUp(tx *sql.Tx) error

CreateElementsUp creates `elements` table and fills it with data

func CreateLeaguesDown

func CreateLeaguesDown(tx *sql.Tx) error

CreateLeaguesDown drops `leagues` table

func CreateLeaguesUp

func CreateLeaguesUp(tx *sql.Tx) error

CreateLeaguesUp creates `leagues` table and fills it with data

func CreateLocationsDown

func CreateLocationsDown(tx *sql.Tx) error

CreateLocationsDown drops `locations` table

func CreateLocationsUp

func CreateLocationsUp(tx *sql.Tx) error

CreateLocationsUp creates `locations` table and fills it with data

func CreateOrdersCompletionsDown

func CreateOrdersCompletionsDown(tx *sql.Tx) error

CreateOrdersCompletionsDown drops `orders_completions` table

func CreateOrdersCompletionsUp

func CreateOrdersCompletionsUp(tx *sql.Tx) error

CreateOrdersCompletionsUp creates `orders_completions` table

func CreateOrdersDown

func CreateOrdersDown(tx *sql.Tx) error

CreateOrdersDown drops `chats` table

func CreateOrdersUp

func CreateOrdersUp(tx *sql.Tx) error

CreateOrdersUp creates `orders` table

func CreatePlayersDown

func CreatePlayersDown(tx *sql.Tx) error

CreatePlayersDown drops `players` table

func CreatePlayersUp

func CreatePlayersUp(tx *sql.Tx) error

CreatePlayersUp creates `players` table

func CreatePokememesDown

func CreatePokememesDown(tx *sql.Tx) error

CreatePokememesDown drops `pokememes` table

func CreatePokememesUp

func CreatePokememesUp(tx *sql.Tx) error

CreatePokememesUp creates `pokememes` table

func CreateProfileRelationsDown

func CreateProfileRelationsDown(tx *sql.Tx) error

CreateProfileRelationsDown drops profile-pokememes relation table

func CreateProfileRelationsUp

func CreateProfileRelationsUp(tx *sql.Tx) error

CreateProfileRelationsUp creates profile-pokememes relation table

func CreateProfilesDown

func CreateProfilesDown(tx *sql.Tx) error

CreateProfilesDown drops `profiles` table

func CreateProfilesUp

func CreateProfilesUp(tx *sql.Tx) error

CreateProfilesUp creates `profiles` table

func CreateRelationsDown

func CreateRelationsDown(tx *sql.Tx) error

CreateRelationsDown drops pokememe-* relations tables

func CreateRelationsUp

func CreateRelationsUp(tx *sql.Tx) error

CreateRelationsUp creates tables for pokememes-locations and pokememes-elements links

func CreateSquadsDown

func CreateSquadsDown(tx *sql.Tx) error

CreateSquadsDown drops `squads` table

func CreateSquadsUp

func CreateSquadsUp(tx *sql.Tx) error

CreateSquadsUp creates `squads` table

func CreateTournamentReportsDown

func CreateTournamentReportsDown(tx *sql.Tx) error

CreateTournamentReportsDown drops `tournament_reports` table

func CreateTournamentReportsUp

func CreateTournamentReportsUp(tx *sql.Tx) error

CreateTournamentReportsUp creates `tournament_reports` table

func CreateWeaponsAndAddWealthDown

func CreateWeaponsAndAddWealthDown(tx *sql.Tx) error

CreateWeaponsAndAddWealthDown drops `weapons` table and `wealth` column of `profiles` table

func CreateWeaponsAndAddWealthUp

func CreateWeaponsAndAddWealthUp(tx *sql.Tx) error

CreateWeaponsAndAddWealthUp creates `weapons` table and adds `wealth` column to `profiles`

func DeleteDataMappedTablesDown

func DeleteDataMappedTablesDown(tx *sql.Tx) error

DeleteDataMappedTablesDown returns old tables with all data

func DeleteDataMappedTablesUp

func DeleteDataMappedTablesUp(tx *sql.Tx) error

DeleteDataMappedTablesUp drops `locations`, `elements`, `weapons` and `leagues` tables These tables data is rarely changed, so I decided to hold such data in source code

func DeletePokememesTablesDown

func DeletePokememesTablesDown(tx *sql.Tx) error

DeletePokememesTablesDown does nothing, because after nerf old information isn't needed at all

func DeletePokememesTablesUp

func DeletePokememesTablesUp(tx *sql.Tx) error

DeletePokememesTablesUp drops `pokememes`, `pokememes_elements` and `pokememes_locations` tables These tables data is rarely changed, so I decided to hold such data in source code

func FixLeaguesNamesDown

func FixLeaguesNamesDown(tx *sql.Tx) error

FixLeaguesNamesDown does nothing

func FixLeaguesNamesUp

func FixLeaguesNamesUp(tx *sql.Tx) error

FixLeaguesNamesUp fixes league naming issues

func FixLocationsDown

func FixLocationsDown(tx *sql.Tx) error

FixLocationsDown does nothing

func FixLocationsUp

func FixLocationsUp(tx *sql.Tx) error

FixLocationsUp fixes location issues

func FixTimeElementDown

func FixTimeElementDown(tx *sql.Tx) error

FixTimeElementDown returns fucked up emoji of time element for sanity

func FixTimeElementUp

func FixTimeElementUp(tx *sql.Tx) error

FixTimeElementUp fixes time element emoji

func HelloUp

func HelloUp(tx *sql.Tx) error

HelloUp is the first migration, added for testing purposes

func New

func New(ac *appcontext.Context)

New is an initialization function for migrations package

func ProfileDataAdditionsDown

func ProfileDataAdditionsDown(tx *sql.Tx) error

ProfileDataAdditionsDown drops `levels` table and `pokeballs` column of `profiles` table

func ProfileDataAdditionsUp

func ProfileDataAdditionsUp(tx *sql.Tx) error

ProfileDataAdditionsUp creates some helping databases for profiles

func RemoveReusableDown

func RemoveReusableDown(tx *sql.Tx) error

RemoveReusableDown reverts `reusable` column

func RemoveReusableUp

func RemoveReusableUp(tx *sql.Tx) error

RemoveReusableUp removes `reusable` field in `orders` table

func UpdateLeaguesDown

func UpdateLeaguesDown(tx *sql.Tx) error

UpdateLeaguesDown returns leagues emoji fuckup for sanity purposes

func UpdateLeaguesUp

func UpdateLeaguesUp(tx *sql.Tx) error

UpdateLeaguesUp fixes some fuckup with leagues' emoji

func UpdateLocationsDown

func UpdateLocationsDown(tx *sql.Tx) error

UpdateLocationsDown returns location emoji fuckup for sanity purposes

func UpdateLocationsUp

func UpdateLocationsUp(tx *sql.Tx) error

UpdateLocationsUp fixes some fuckup with locations' emoji

Types

type Migrations

type Migrations struct{}

Migrations handles all functions of migrations package

func (*Migrations) Init

func (m *Migrations) Init()

Init adds all migrations to applications

func (*Migrations) Migrate

func (m *Migrations) Migrate() error

Migrate migrates database to current version

func (*Migrations) SetDialect

func (m *Migrations) SetDialect(dialect string) error

SetDialect sets dialect for migrations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL