migrations

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: Apache-2.0 Imports: 11 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(dbConf *data.Database, cacheConf *data.CacheConf) error

Migrate database to current version

func UpdateInstallInfo added in v0.3.0

func UpdateInstallInfo(dataConf *data.Database, language string,
	siteName string,
	siteURL string,
	contactEmail string,
	adminName string,
	adminPassword string,
	adminEmail string) error

UpdateInstallInfo update some init data about the admin interface and admin password

Types

type Migration

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

Migration describes on migration from lower version to high version

func NewMigration

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

NewMigration creates a new migration

Jump to

Keyboard shortcuts

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