migrations

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLatestVersion

func CheckLatestVersion(sourceDriver source.Driver, currentVersion uint) error

Returns nil if currentVersion corresponds to the latest available migration, otherwise an error explaining why not.

func Down

func Down(db *sql.DB) error

Down runs all down SQL migrations.

func EnsureClean

func EnsureClean(db *sql.DB) error

EnsureClean checks whether all migrations for the current version have been applied, without making any changes to the database. If not, returns a non-nil error.

func Stepper added in v0.12.6

func Stepper(db *sql.DB) (next func() (version uint, more bool, err error), err error)

Stepper returns a function that runs SQL migrations one step at a time.

Stepper cannot be closed pre-emptively, it must be run to completion (or until an error is encountered).

func Up

func Up(db *sql.DB) (retErr error)

Up runs SQL migrations to ensure the database schema is up-to-date.

Types

This section is empty.

Jump to

Keyboard shortcuts

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