Documentation ¶
Index ¶
- Constants
- type ErrCouldNotCreateMigrationsTable
- type ErrCouldNotExecuteMigration
- type ErrCouldNotRollbackMigration
- type ErrInvalidMigrationInstruction
- type ErrInvalidOpts
- type ErrMigrationNotFound
- type ErrMigrationsNotImplementedForDriver
- type ErrNoMigrationsFound
- type Migration
- type MigrationDirection
- type MigrationExecutor
- type MigrationInstruction
- type MigrationList
- func (ml MigrationList) All() []Migration
- func (ml MigrationList) GetFirstMigration() (*Migration, bool)
- func (ml MigrationList) GetLatestMigration() (*Migration, bool)
- func (ml MigrationList) MigrationsFromId(id string) ([]Migration, error)
- func (ml MigrationList) MigrationsUpToId(id string) ([]Migration, error)
- type MigrationOpts
- type MigrationRecord
- type MigrationRecordDb
- type MigrationRecordEvent
- type MigrationState
- type Migrator
- type Opts
Constants ¶
View Source
const MigrateToLatest = "MIGRATE_TO_LATEST"
View Source
const MigrateToNothing = "MIGRATE_TO_NOTHING"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCouldNotCreateMigrationsTable ¶
type ErrCouldNotCreateMigrationsTable struct { Wrapped error RollbackError error CommitError error }
func (ErrCouldNotCreateMigrationsTable) Error ¶
func (e ErrCouldNotCreateMigrationsTable) Error() string
type ErrCouldNotExecuteMigration ¶
type ErrCouldNotExecuteMigration struct { Name string Wrapped error RollbackError error CommitError error }
func (ErrCouldNotExecuteMigration) Error ¶
func (e ErrCouldNotExecuteMigration) Error() string
type ErrCouldNotRollbackMigration ¶
type ErrCouldNotRollbackMigration struct { Name string Wrapped error RollbackError error CommitError error }
func (ErrCouldNotRollbackMigration) Error ¶
func (e ErrCouldNotRollbackMigration) Error() string
type ErrInvalidMigrationInstruction ¶
type ErrInvalidMigrationInstruction struct {
Message string
}
func (ErrInvalidMigrationInstruction) Error ¶
func (e ErrInvalidMigrationInstruction) Error() string
type ErrInvalidOpts ¶
type ErrInvalidOpts struct {
Message string
}
func (ErrInvalidOpts) Error ¶
func (e ErrInvalidOpts) Error() string
type ErrMigrationNotFound ¶
type ErrMigrationNotFound struct {
Id string
}
func (ErrMigrationNotFound) Error ¶
func (e ErrMigrationNotFound) Error() string
type ErrMigrationsNotImplementedForDriver ¶
type ErrMigrationsNotImplementedForDriver struct {
Driver string
}
func (ErrMigrationsNotImplementedForDriver) Error ¶
func (e ErrMigrationsNotImplementedForDriver) Error() string
type ErrNoMigrationsFound ¶
type ErrNoMigrationsFound struct{}
func (ErrNoMigrationsFound) Error ¶
func (e ErrNoMigrationsFound) Error() string
type Migration ¶
type Migration struct { Id string Name string Execute MigrationExecutor Rollback MigrationExecutor }
type MigrationDirection ¶
type MigrationDirection string
const MigrationDown MigrationDirection = "down"
const MigrationUp MigrationDirection = "up"
type MigrationInstruction ¶
type MigrationInstruction struct { Direction MigrationDirection Target string }
type MigrationList ¶
type MigrationList struct {
// contains filtered or unexported fields
}
func NewMigrationList ¶
func NewMigrationList(migs []Migration) MigrationList
func (MigrationList) All ¶
func (ml MigrationList) All() []Migration
func (MigrationList) GetFirstMigration ¶
func (ml MigrationList) GetFirstMigration() (*Migration, bool)
func (MigrationList) GetLatestMigration ¶
func (ml MigrationList) GetLatestMigration() (*Migration, bool)
func (MigrationList) MigrationsFromId ¶
func (ml MigrationList) MigrationsFromId(id string) ([]Migration, error)
func (MigrationList) MigrationsUpToId ¶
func (ml MigrationList) MigrationsUpToId(id string) ([]Migration, error)
type MigrationOpts ¶
type MigrationRecord ¶
type MigrationRecord struct { Id string Status string Events []MigrationRecordEvent }
type MigrationRecordDb ¶
type MigrationRecordEvent ¶
type MigrationState ¶
type MigrationState string
const MigrationApplied MigrationState = "applied"
const MigrationFailed MigrationState = "failed"
const MigrationPending MigrationState = "pending"
const MigrationRollbackFailed MigrationState = "rollback_failed"
const MigrationRolledBack MigrationState = "rolled_back"
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func (*Migrator) ListMigrations ¶
func (m *Migrator) ListMigrations() ([]*MigrationRecord, error)
Click to show internal directories.
Click to hide internal directories.