Versions in this module Expand all Collapse all v0 v0.0.3 Sep 3, 2024 Changes in this version + var MigrationDialects = map[string]gorp.Dialect + func Exec(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection) (int, error) + func ExecMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + func SetIgnoreUnknown(v bool) + func SetSchema(name string) + func SetTable(name string) + func SkipMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + type AssetMigrationSource struct + Asset func(path string) ([]byte, error) + AssetDir func(path string) ([]string, error) + Dir string + func (a AssetMigrationSource) FindMigrations() ([]*Migration, error) + type EmbedFileSystemMigrationSource struct + FileSystem embed.FS + Root string + func (f EmbedFileSystemMigrationSource) FindMigrations() ([]*Migration, error) + type FileMigrationSource struct + Dir string + func (f FileMigrationSource) FindMigrations() ([]*Migration, error) + type HttpFileSystemMigrationSource struct + FileSystem http.FileSystem + func (f HttpFileSystemMigrationSource) FindMigrations() ([]*Migration, error) + type MemoryMigrationSource struct + Migrations []*Migration + func (m MemoryMigrationSource) FindMigrations() ([]*Migration, error) + type Migration struct + DisableTransactionDown bool + DisableTransactionUp bool + Down []string + Id string + SQL string + Up []string + func ParseMigration(id string, r io.ReadSeeker) (*Migration, error) + func ToApply(migrations []*Migration, current string, direction MigrationDirection) []*Migration + func (m Migration) Less(other *Migration) bool + func (m Migration) NumberPrefixMatches() []string + func (m Migration) VersionInt() int64 + type MigrationDirection int + const Down + const Up + type MigrationRecord struct + AppliedAt time.Time + Id string + MigrationSQL string + func GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) + type MigrationSet struct + IgnoreUnknown bool + SchemaName string + TableName string + func (ms MigrationSet) Exec(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection) (int, error) + func (ms MigrationSet) ExecMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + func (ms MigrationSet) GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) + func (ms MigrationSet) PlanMigration(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) ([]*PlannedMigration, *gorp.DbMap, error) + type MigrationSource interface + FindMigrations func() ([]*Migration, error) + type OracleDialect struct + func (d OracleDialect) IfSchemaNotExists(command, schema string) string + func (d OracleDialect) IfTableExists(command, schema, table string) string + func (d OracleDialect) IfTableNotExists(command, schema, table string) string + type PackrBox interface + Find func(name string) ([]byte, error) + List func() []string + type PackrMigrationSource struct + Box PackrBox + Dir string + func (p PackrMigrationSource) FindMigrations() ([]*Migration, error) + type PlanError struct + ErrorMessage string + Migration *Migration + func (p *PlanError) Error() string + type PlannedMigration struct + DisableTransaction bool + Queries []string + func PlanMigration(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) ([]*PlannedMigration, *gorp.DbMap, error) + func ToCatchup(migrations, existingMigrations []*Migration, lastRun *Migration) []*PlannedMigration + type SqlExecutor interface + Delete func(list ...interface{}) (int64, error) + Exec func(query string, args ...interface{}) (sql.Result, error) + Insert func(list ...interface{}) error + type TxError struct + Err error + Migration *Migration + func (e *TxError) Error() string