migrate

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoChanges = fmt.Errorf("no changes")
)

Functions

func SrcFile

func SrcFile(migrationName, packageName string, up, down ToGoer) (string, error)

Types

type Migration

type Migration struct {
	Name string
	Up   func() builder.ToSQLer
	Down func() builder.ToSQLer
}

type Migrations

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

func New

func New() *Migrations

func (*Migrations) Add

func (m *Migrations) Add(migration *Migration)

func (*Migrations) Blueprint

func (m *Migrations) Blueprint(tableName string) *schema.Blueprint

func (*Migrations) GenerateMigration

func (m *Migrations) GenerateMigration(migrationName, packageName string, model models.Model) (string, error)

func (*Migrations) Up

func (m *Migrations) Up(tx sqlx.Execer) error

type ToGoer

type ToGoer interface {
	ToGo() string
}

Jump to

Keyboard shortcuts

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