migrations

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectedVersion

func ExpectedVersion() int64

ExpectedVersion returns the expected db version

func GetCurrentDBVersion

func GetCurrentDBVersion(engine *xorm.Engine) (int64, error)

GetCurrentDBVersion returns the current db version

func InitDB

func InitDB(dataConf *data.Database) (err error)

InitDB init db

func Migrate

func Migrate(dataConf *data.Database) error

Migrate database to current version

Types

type Migration

type Migration interface {
	Description() string
	Migrate(*xorm.Engine) error
}

Migration describes on migration from lower version to high version

func NewMigration

func NewMigration(desc string, fn func(*xorm.Engine) error) Migration

NewMigration creates a new migration

Jump to

Keyboard shortcuts

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