migrations

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 15 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

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) error

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

func UpWithFS added in v2.11.0

func UpWithFS(db *sql.DB, migs fs.FS) (retErr error)

UpWithFS runs SQL migrations in the given fs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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