migrations

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbEnvVar = "DATABASE_URL"
)
View Source
const (
	FilePrefix = "20060102150405"
)

Variables

View Source
var (
	// ErrLocationIsNotDirectory is the error when the location is not a directory.
	ErrLocationIsNotDirectory = errors.New("location is not a directory")
)
View Source
var (
	// ErrNoCurrentVersion is the error when there is no current version.
	ErrNoCurrentVersion = errors.New("no current version")
)

Functions

func ConnectDB

func ConnectDB() (*sqlx.DB, error)

Types

type Versioning

type Versioning interface {
	MigrateUp() error
	MigrateDown() error
	GetStatus() ([]*models.GoschemaMigrationVersion, error)
}

func NewVersioning

func NewVersioning(db *sqlx.DB, migrationLocation string, steps int) Versioning

Jump to

Keyboard shortcuts

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