migrate

package
v0.0.0-...-1d0ba01 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlxMigrate

type SqlxMigrate struct {
	Migrations []SqlxMigration
	// contains filtered or unexported fields
}

SqlxMigrate ...

func New

func New() *SqlxMigrate

New ...

func (*SqlxMigrate) Add

func (s *SqlxMigrate) Add(m SqlxMigration)

Add ...

func (*SqlxMigrate) ColumnName

func (s *SqlxMigrate) ColumnName() string

ColumnName ...

func (*SqlxMigrate) Migrate

func (s *SqlxMigrate) Migrate(db *sqlx.DB) (int, error)

Migrate ...

func (*SqlxMigrate) Rollback

func (s *SqlxMigrate) Rollback(db *sqlx.DB) error

Rollback ...

func (*SqlxMigrate) Run

func (s *SqlxMigrate) Run(db *sqlx.DB, steps int) (int, error)

Run ...

func (*SqlxMigrate) Step

func (s *SqlxMigrate) Step(db *sqlx.DB) (int, error)

Step applies 1 migration (up)

func (*SqlxMigrate) TableName

func (s *SqlxMigrate) TableName() string

TableName ...

type SqlxMigration

type SqlxMigration struct {
	Up   func(tx *sqlx.Tx) error
	Down func(tx *sqlx.Tx) error
	// contains filtered or unexported fields
}

SqlxMigration ...

func NewMigration

func NewMigration(up, down string) SqlxMigration

NewMigration ...

type SqlxVersion

type SqlxVersion struct {
	Version int
}

SqlxVersion ...

Jump to

Keyboard shortcuts

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