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

dbmigrate

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMigrate

func DeleteMigrate(db *sql.DB, id string) error

DeleteMigrate delete an ID from table gorp_migrations

func Do

func Do(DBFunc func() *sql.DB, dialect gorp.Dialect, sqlMigrateDir string, dir migrate.MigrationDirection, dryrun bool, limit int) ([]*migrate.PlannedMigration, error)

Do applies migration

func Get

func Get(DBFunc func() *sql.DB, dir string, dialect gorp.Dialect) ([]sdk.DatabaseMigrationStatus, error)

Get the status of all migration scripts

func List

func List(db *sql.DB) ([]sdk.DatabaseMigrationStatus, error)

List list current entries from gorp_migration only

func UnlockMigrate

func UnlockMigrate(db *sql.DB, id string, dialect gorp.Dialect) error

UnlockMigrate unlocks an ID from table gorp_migrations_lock

Types

type DatabaseMigration

type DatabaseMigration struct {
	ID        string     `db:"id"`
	AppliedAt *time.Time `db:"applied_at"`
}

DatabaseMigration represents an entry in table gorp_migrations

type MigrationLock

type MigrationLock struct {
	ID       string     `db:"id"`
	Locked   *time.Time `db:"locked"`
	Unlocked *time.Time `db:"unlocked"`
}

MigrationLock is used to lock the migration (managed by gorp)

Jump to

Keyboard shortcuts

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