migrate

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, connURL, migrationsPath string) (err error)

Run runs golang-migrate "up" from file://migrationsPath using connURL. ErrNoChange is ignored. ctx is checked before starting; if cancelled, returns ctx.Err(). The library's Up() does not accept context, so a migration in progress cannot be cancelled—on context cancellation Run returns only after the current Up() call completes. For graceful shutdown, run migrations in a separate one-off process (e.g. init container or CI job); otherwise an in-progress migration will block process exit until it finishes. connURL and migrationsPath must be non-empty. migrationsPath is cleaned and should be under application control (not user input).

Types

This section is empty.

Jump to

Keyboard shortcuts

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