Documentation ¶
Index ¶
- type Migration
- type MigrationType
- type Migrator
- func (m *Migrator) Add(migration Migration)
- func (m Migrator) ExecuteCommands(commands []string) (outputs []string, err error)
- func (m *Migrator) GetValidMigrations(currentVersion string, migrationTypes ...MigrationType) (migrations []Migration)
- func (m Migrator) IsValid(migrationVersion, currentVersion string) (bool, error)
- func (m *Migrator) Run(currentVersion string, migrationTypes ...MigrationType) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration interface { Migrate() error Version() string Info() string Type() MigrationType }
type MigrationType ¶ added in v0.9.5
type MigrationType int
MigrationType is migration type
const ( // MigrationTypeClient is client migration type MigrationTypeClient MigrationType = iota + 1 // MigrationTypeServer is server migration type MigrationTypeServer )
type Migrator ¶
type Migrator struct { Migrations []Migration Log *zap.SugaredLogger }
func NewMigrator ¶
func NewMigrator() *Migrator
func (Migrator) ExecuteCommands ¶
func (*Migrator) GetValidMigrations ¶
func (m *Migrator) GetValidMigrations(currentVersion string, migrationTypes ...MigrationType) (migrations []Migration)
Click to show internal directories.
Click to hide internal directories.