dbmigrate

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrateOptions

type MigrateOptions struct {
	// MaxSteps is the maximum number of migrations to apply either up or down.
	// Leave nil or set -1 for an unlimited number.
	MaxSteps *int
}

MigrateOptions are options for a migrate operation.

type MigrateResult

type MigrateResult struct {
	// Versions are migration versions that were added (for up migrations) or
	// removed (for down migrations) for this run.
	Versions []int64
}

MigrateResult is the result of a migrate operation.

type Migrator

type Migrator struct {
	baseservice.BaseService
	// contains filtered or unexported fields
}

Migrator is a database migration tool for River which can run up or down migrations in order to establish the schema that the queue needs to run.

func NewMigrator

func NewMigrator(archetype *baseservice.Archetype) *Migrator

func (*Migrator) Down

func (m *Migrator) Down(ctx context.Context, txBeginner dbutil.TxBeginner, opts *MigrateOptions) (*MigrateResult, error)

Down runs down migrations.

func (*Migrator) Up

func (m *Migrator) Up(ctx context.Context, txBeginner dbutil.TxBeginner, opts *MigrateOptions) (*MigrateResult, error)

Up runs up migrations.

Jump to

Keyboard shortcuts

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