pms

package module
v0.0.0-...-6606e50 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TABLE_NAME         = "migrations"
	QUERY_CREATE_TABLE = `CREATE TABLE %s (
		version VARCHAR(255) NOT NULL DEFAULT 0
	);
	INSERT INTO migrations (version) VALUES (0);`
	QUERY_UPDATE_VERSION = "UPDATE %s SET version=%d"
	ERROR_EQUAL_VERSION  = "current version %d equals current"
)
View Source
const (
	SELECT_VERSION = "SELECT version FROM migrations"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	DIRECTION_UP   Direction = "up"
	DIRECTION_DOWN Direction = "down"
)

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func New

func New(db *sqlx.DB, path string) (*Migrator, error)

func (*Migrator) Down

func (m *Migrator) Down() error

func (*Migrator) Up

func (m *Migrator) Up() error

func (*Migrator) Version

func (m *Migrator) Version(version int) error

Jump to

Keyboard shortcuts

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