Versions in this module Expand all Collapse all v0 v0.1.1 Dec 15, 2024 Changes in this version + var DefaultOptions = &Options + var ErrMigrationIDDoesNotExist = errors.New("sqlxmigrate: Tried to migrate to an ID that doesn't exist") + var ErrMissingID = errors.New("sqlxmigrate: Missing ID in migration") + var ErrNoMigrationDefined = errors.New("sqlxmigrate: No migration defined") + var ErrNoRunMigration = errors.New("sqlxmigrate: Could not find last run migration") + var ErrRollbackImpossible = errors.New("sqlxmigrate: It's impossible to rollback this migration") + type DuplicatedIDError struct + ID string + func (e *DuplicatedIDError) Error() string + type InitSchemaFunc func(*sqlx.DB) error + type MigrateFunc func(*sql.Tx) error + type Migration struct + ID string + Migrate MigrateFunc + Rollback RollbackFunc + type Options struct + IDColumnName string + IDColumnSize int + TableName string + type ReservedIDError struct + ID string + func (e *ReservedIDError) Error() string + type RollbackFunc func(*sql.Tx) error + type Sqlxmigrate struct + func New(db *sqlx.DB, options *Options, migrations []*Migration) *Sqlxmigrate + func (g *Sqlxmigrate) HasTable(tableName string) (bool, error) + func (g *Sqlxmigrate) InitSchema(initSchema InitSchemaFunc) + func (g *Sqlxmigrate) Migrate() error + func (g *Sqlxmigrate) MigrateTo(migrationID string) error + func (g *Sqlxmigrate) RollbackLast() error + func (g *Sqlxmigrate) RollbackMigration(m *Migration) error + func (g *Sqlxmigrate) RollbackTo(migrationID string) error + func (g *Sqlxmigrate) SetLogger(logger *log.Logger)