migrator

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log added in v0.9.0

type Log struct{}

func (Log) Printf added in v0.9.0

func (Log) Printf(format string, v ...interface{})

func (Log) Verbose added in v0.9.0

func (Log) Verbose() bool

type Migration added in v0.9.0

type Migration struct {
	Version    int
	Identifier string
}

type Migrator

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

func New

func New(db *sql.DB, opts *Options) *Migrator

func (*Migrator) Reset

func (m *Migrator) Reset() error

Reset reset database

func (*Migrator) Status

func (m *Migrator) Status() (status Status, err error)

Status returns the current status

func (*Migrator) Up

func (m *Migrator) Up() error

Up runs db migrations

type Options added in v0.9.0

type Options struct {
	Quiet bool
}

type Status added in v0.9.0

type Status struct {
	Version   int
	Dirty     bool
	Executeds []Migration
	Pendings  []Migration
}

func (Status) String added in v0.9.0

func (s Status) String() string

Jump to

Keyboard shortcuts

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