migrations

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Latest

func Latest() int

Latest returns the highest registered migration version: the schema this binary runs.

func Run

func Run(ctx context.Context, db *sql.DB, driver string) error

Run executes all pending migrations for the specified database driver.

Types

type Migration

type Migration struct {
	Version  int
	Name     string
	SQLite   string
	Postgres string
	// Check runs in the migration's transaction before its SQL; an error refuses the migration
	// with nothing altered, and the server does not start.
	Check func(context.Context, *sql.Tx) error
}

Migration represents an incremental schema change step.

Jump to

Keyboard shortcuts

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