migrator

package module
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 7 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 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.

func RecreateDatabaseAndInitTables

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

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