Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInitializeFail = errors.New("failed to initialize") ErrBrokenSchemaHistory = errors.New("broken schema history detected") ErrDuplicatedMigrationName = errors.New("duplicated migration name detected") ErrInvalidMigrations = errors.New("invalid migrations") ErrMigrationMissing = fmt.Errorf("%w(missing)", ErrInvalidMigrations) ErrMigrationModified = fmt.Errorf("%w(modified)", ErrInvalidMigrations) )
Functions ¶
This section is empty.
Types ¶
type BaseExecutor ¶
type BaseExecutor struct {
// contains filtered or unexported fields
}
func (*BaseExecutor) GetSchemaHistoryTableName ¶
func (b *BaseExecutor) GetSchemaHistoryTableName() string
func (*BaseExecutor) SetSchemaHistoryTableName ¶
func (b *BaseExecutor) SetSchemaHistoryTableName(tableName string) error
type MigrateStatus ¶
type MigrateStatus int
const ( DefaultSchemaHistoryTableName = "gomigrate_schema_history" StatusUnknown MigrateStatus = iota StatusInstalled StatusReadyToInstall StatusMigrationMissing StatusMigrationModified StatusBrokenSchemaHistory )
type Migration ¶
func (*Migration) GetContentHash ¶
type MigrationExecutor ¶
type MigrationExecutor interface { GetSchemaHistoryTableName() string SetSchemaHistoryTableName(tableName string) error SetMigrations(migrations []Migration) InitSchemaHistoryTable() error ShowMigrations() error InstallMigrations() error }
func NewMySQLMigrateExecutor ¶
func NewMySQLMigrateExecutor(connSource string) MigrationExecutor
type MigrationVersion ¶ added in v0.8.8
type MigrationVersion []int
func ParseMigrationVersion ¶ added in v0.8.8
func ParseMigrationVersion(version string) (MigrationVersion, error)
func (MigrationVersion) String ¶ added in v0.8.8
func (m MigrationVersion) String() string
type SortableMigration ¶
type SortableMigrations ¶
type SortableMigrations []*SortableMigration
func (SortableMigrations) Len ¶
func (s SortableMigrations) Len() int
func (SortableMigrations) Less ¶
func (s SortableMigrations) Less(i, j int) bool
func (SortableMigrations) Swap ¶
func (s SortableMigrations) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.