pgmigrator

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(migrationsDir, name string) (fullPath string, err error)

Create a new migration file with a given name

Types

type Migrator

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

Migrator represents a migration service

func NewMigrator

func NewMigrator(db *sql.DB, source fs.FS) *Migrator

NewMigrator returns a new Migrator

func (*Migrator) Down

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

Down rollback a number of migrations

func (*Migrator) Up

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

Up applies all migrations

Jump to

Keyboard shortcuts

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