migrate

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbeddedSource

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

EmbeddedSource holds embedded FS introduced in go 1.16

func NewEmbeddedSource

func NewEmbeddedSource() *EmbeddedSource

NewEmbeddedSource returns a new EmbeddedSource

func (*EmbeddedSource) FindMigrations

func (m *EmbeddedSource) FindMigrations() ([]*sqlmigrate.Migration, error)

FindMigrations implements sql-migrate.MigrationSource interface

type Migrator

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

Migrator represents a migration service

func NewMigrator

func NewMigrator(db *sql.DB, source migrate.MigrationSource) *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