migrate

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, db db.DB, migrations []Migration) (err error)

func Rollback

func Rollback(ctx context.Context, db db.DB, migrations []Migration, numberToRollback int64) (err error)

Rollback undo the latest migration

Types

type Migration

type Migration struct {
	ID   int64
	Up   func(ctx context.Context, tx db.Queryer) (err error)
	Down func(ctx context.Context, tx db.Queryer) (err error)
}

Jump to

Keyboard shortcuts

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