versionrepo

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToVersion

func ConnectToVersion()

ConnectToVersion connects to the mytoken database and asserts that the database is up-to-date to the current version

func SetVersionAfter

func SetVersionAfter(rlog log.Ext1FieldLogger, tx *sqlx.Tx, version string) error

SetVersionAfter sets that the after db migration commands for the passed version were executed

func SetVersionBefore

func SetVersionBefore(rlog log.Ext1FieldLogger, tx *sqlx.Tx, version string) error

SetVersionBefore sets that the before db migration commands for the passed version were executed

Types

type DBVersionState

type DBVersionState []UpdateTimes

DBVersionState describes the version state of the db

func GetVersionState

func GetVersionState(rlog log.Ext1FieldLogger, tx *sqlx.Tx) (state DBVersionState, err error)

GetVersionState returns the DBVersionState

func (DBVersionState) Len

func (state DBVersionState) Len() int

Len returns the len of DBVersionState

func (DBVersionState) Less

func (state DBVersionState) Less(i, j int) bool

Less checks if a version is less than another

func (DBVersionState) Sort

func (state DBVersionState) Sort()

Sort sorts this DBVersionState by the version

func (DBVersionState) Swap

func (state DBVersionState) Swap(i, j int)

Swap swaps to elements of DBVersionState

type UpdateTimes

type UpdateTimes struct {
	Version string
	Before  sql.NullTime `db:"bef"`
	After   sql.NullTime `db:"aft"`
}

UpdateTimes is a type for checking if the db migration commands for different mytoken version have been executed

Jump to

Keyboard shortcuts

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