migrator

package module
v0.0.0-...-9634a1a Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTablesWithoutRollBack

func InitTablesWithoutRollBack(db *gorm.DB, database string) bool

func MigrateMySQL

func MigrateMySQL(cfg MySqlConfig) bool

if configured database does not exist, it is considered a new dployment, will create database and init tables; if configured database exsits, 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 exsits, and db_version table exists, check wheather db_version is the latest version

and upgrade based the result.

func UpgradeIfDBVersionNotLatest

func UpgradeIfDBVersionNotLatest(db *gorm.DB, cfg MySqlConfig) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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