Help us shape the future of Go! Take the 2026 Go Developer Survey

migrate

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package migrate provides database migration support using golang-migrate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Down

func Down(db *sql.DB) error

Down rolls back all migrations. Use with caution - this will destroy all data.

func Run

func Run(db *sql.DB) error

Run executes all pending database migrations. It applies migrations in order and is idempotent - already applied migrations are skipped.

func Steps

func Steps(db *sql.DB, n int) error

Steps applies n migrations (positive = up, negative = down).

func Version

func Version(db *sql.DB) (version uint, dirty bool, err error)

Version returns the current migration version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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