Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { ID string Name string Migrate func(tx *sqlx.Tx) error Rollback func(tx *sqlx.Tx) error }
Migration is a unique ID plus a function that uses a sqlx transaction to perform a database migration step.
type SqlxMigrate ¶
type SqlxMigrate struct {
// contains filtered or unexported fields
}
SqlxMigrate is a migrator that uses github.com/jmoiron/sqlx
func New ¶
func New(db *sqlx.DB, migrations []Migration) *SqlxMigrate
New creates a SqlxMigrate instance
func (*SqlxMigrate) Migrate ¶
func (m *SqlxMigrate) Migrate() error
Migrate will run the migrations using the provided db connection.
func (*SqlxMigrate) Rollback ¶
func (m *SqlxMigrate) Rollback() error
Rollback will run all rollbacks using the provided db connection.
Click to show internal directories.
Click to hide internal directories.