Versions in this module Expand all Collapse all v1 v1.0.0 May 19, 2020 Changes in this version + var ErrNoPreviousVersion = errors.New("no previous version found") + var ErrTableDoesNotExist = errors.New("table does not exist") + func CreateMigration(name, migrationType, dir string, t time.Time) (path string, err error) + func EnsureDBVersion(conf *DBConf, db *sql.DB) (int64, error) + func FinalizeMigration(conf *DBConf, txn *sql.Tx, direction bool, v int64, checksum string) error + func GetDBVersion(conf *DBConf) (version int64, err error) + func GetMostRecentDBVersion(dirpath string) (version int64, err error) + func GetPreviousDBVersion(dirpath string, version int64) (previous int64, err error) + func NumericComponent(name string) (int64, error) + func OpenDBFromDBConf(conf *DBConf) (*sql.DB, error) + func RunMigrations(conf *DBConf, migrationsDir string, target int64) (err error) + func RunMigrationsOnDb(conf *DBConf, migrationsDir string, target int64, db *sql.DB) (err error) + type CheckSumRecord struct + Checksum string + type DBConf struct + Driver DBDriver + Env string + MigrationsDir string + PgSchema string + func NewDBConf(p, env string, pgschema string) (*DBConf, error) + type DBDriver struct + Dialect SqlDialect + Import string + Name string + OpenStr string + func (drv *DBDriver) IsValid() bool + type Migration struct + Next int64 + Previous int64 + Source string + Version int64 + func CollectMigrations(dirpath string, current, target int64) (m []*Migration, err error) + func PreviousMigrations(dirpath string, current int64) (m []*Migration, err error) + type MigrationRecord struct + IsApplied bool + TStamp time.Time + VersionId int64 + type MySqlDialect struct + type PostgresDialect struct + type SqlDialect interface + type Sqlite3Dialect struct