migrations

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaVersion = 5

SchemaVersion is the schema version this binary expects. Increment this and add a new Migration entry each time the schema changes.

Functions

func Check

func Check(db *sql.DB) error

Check returns an error if the database schema is behind the expected version.

func Run

func Run(db *sql.DB, verbose bool) error

Run applies any pending migrations. If verbose is true, prints progress and "Already up to date." when no migrations are needed.

Types

type Migration

type Migration struct {
	Version int
	SQL     string
}

Migration represents a single schema change.

Jump to

Keyboard shortcuts

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