Versions in this module Expand all Collapse all v1 v1.0.0 Feb 21, 2021 Changes in this version + const VERSION + var ErrNoCurrentVersion = errors.New("no current version found") + var ErrNoNextVersion = errors.New("no next version found") + var MaxVersion int64 = 9223372036854775807 + func AddMigration(up func(*sql.Tx) error, down func(*sql.Tx) error) + func AddNamedMigration(filename string, up func(*sql.Tx) error, down func(*sql.Tx) error) + func Create(db *sql.DB, fs vfs.FileSystem, name, migrationType string) error + func CreateWithTemplate(db *sql.DB, fs vfs.FileSystem, tmpl *template.Template, ...) error + func Down(db *sql.DB, fs vfs.FileSystem) error + func DownTo(db *sql.DB, fs vfs.FileSystem, version int64) error + func EnsureDBVersion(db *sql.DB, schema string) (int64, error) + func Fix(fs vfs.FileSystem) error + func GetDBVersion(db *sql.DB, schema string) (int64, error) + func NumericComponent(name string) (int64, error) + func OpenDBWithDriver(driver string, dbstring string) (*sql.DB, error) + func OpenDBWithDriverDialect(driver string, dbstring string, dconf DialectConfig) (*sql.DB, error) + func Redo(db *sql.DB, fs vfs.FileSystem) error + func Reset(db *sql.DB, fs vfs.FileSystem) error + func Run(command string, db *sql.DB, fs vfs.FileSystem, args ...string) error + func SetDialect(d string, opts ...DialectConfig) error + func SetLogger(l Logger) + func SetTableName(n string) + func SetVerbose(v bool) + func Status(db *sql.DB, fs vfs.FileSystem) error + func TableName() string + func Up(db *sql.DB, fs vfs.FileSystem) error + func UpByOne(db *sql.DB, fs vfs.FileSystem) error + func UpTo(db *sql.DB, fs vfs.FileSystem, version int64) error + func Version(db *sql.DB, fs vfs.FileSystem) error + type DialectConfig struct + Schema string + SchemaDir bool + SchemaEnvVar string + UseSchemas bool + type Logger interface + Fatal func(v ...interface{}) + Fatalf func(format string, v ...interface{}) + Print func(v ...interface{}) + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) + type Migration struct + DownFn func(*sql.Tx) error + Next int64 + Previous int64 + Registered bool + Schema string + Source string + UpFn func(*sql.Tx) error + Version int64 + func (m *Migration) Down(db *sql.DB) error + func (m *Migration) String() string + func (m *Migration) Up(db *sql.DB) error + type MigrationRecord struct + IsApplied bool + TStamp time.Time + UsingSchema string + VersionID int64 + type Migrations struct + func CollectMigrations(fs vfs.FileSystem, current, target int64) (*Migrations, error) + func (ms *Migrations) Append(m *Migration) + func (ms *Migrations) Current(current int64) (*Migration, error) + func (ms *Migrations) Last() (*Migration, error) + func (ms *Migrations) Len() int + func (ms *Migrations) Less(i, j int) bool + func (ms *Migrations) Next(current int64) (*Migration, error) + func (ms *Migrations) Previous(current int64) (*Migration, error) + func (ms *Migrations) String() string + func (ms *Migrations) Swap(i, j int) + type MySQLDialect struct + type PostgresDialect struct + Schema string + type RedshiftDialect struct + type SQLDialect interface + func GetDialect() SQLDialect + type SQLSchemaDialect interface + type SqlServerDialect struct + type Sqlite3Dialect struct + type TiDBDialect struct