migrations

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 23 Imported by: 75

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureUpToDate added in v1.11.5

func EnsureUpToDate(x *xorm.Engine) error

EnsureUpToDate will check if the db is at the correct version

func ExpectedVersion added in v1.11.5

func ExpectedVersion() int64

ExpectedVersion returns the expected db version

func GetCurrentDBVersion added in v1.11.5

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

GetCurrentDBVersion returns the current db version

func Migrate

func Migrate(x *xorm.Engine) 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

type Version

type Version struct {
	ID      int64 `xorm:"pk autoincr"`
	Version int64
}

Version describes the version table. Should have only one row with id==1

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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