migrate

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(m *Migration)

func Reset

func Reset()

Reset clears all registered migrations. Intended for use in tests only.

Types

type Migration

type Migration struct {
	ID      string
	Name    string
	Message string
	Up      func(ctx context.Context, client *quark.Client) error
	Down    func(ctx context.Context, client *quark.Client) error
}

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(client *quark.Client) *Migrator

func (*Migrator) Down

func (m *Migrator) Down(ctx context.Context, steps int) error

func (*Migrator) GetApplied

func (m *Migrator) GetApplied(ctx context.Context) (map[string]bool, error)

func (*Migrator) Init

func (m *Migrator) Init(ctx context.Context) error

func (*Migrator) Up

func (m *Migrator) Up(ctx context.Context, steps int) error

func (*Migrator) UpDryRun

func (m *Migrator) UpDryRun(ctx context.Context, steps int) error

UpDryRun previews which migrations would be applied without executing them.

Jump to

Keyboard shortcuts

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