Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDatabase ¶
func CreateDatabase(cfg config.MySqlConfig) (databaseExisted bool, err error)
func DropDatabase ¶
func DropDatabase(cfg config.MySqlConfig) error
func Migrate ¶
func Migrate(cfg config.MySqlConfig) error
if configured database does not exist, it is considered a new deployment, will create database and init tables; if configured database exists, but db_version table does not exist, it is also considered a new deployment,
maybe we do not have permission to create database or other reasons, then will init all tables.
if configured database exists, and db_version table exists, check whether db_version is the latest version
and upgrade based the result.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.