Versions in this module Expand all Collapse all v0 v0.1.0 Oct 12, 2024 Changes in this version + const FileNamePrefix + const FileNameSeparator + var ErrBlankMigration = errors.New("could not generate blank migration") + var ErrCreateMigrationsDirPath = errors.New("could not create new migrations directory path") + var TmplContents string + func GenerateBlankMigration(dirPath MigrationsDirPath) (fileName string, err error) + type DirMigrationsRegistry struct + func NewDirMigrationsRegistry(dirPath MigrationsDirPath, allMigrations []Migration) *DirMigrationsRegistry + func NewEmptyDirMigrationsRegistry(dirPath MigrationsDirPath) *DirMigrationsRegistry + func (registry *DirMigrationsRegistry) AssertValidRegistry() + func (registry *DirMigrationsRegistry) HasAllMigrationsRegistered() (bool, []string, []string, error) + type DummyMigration struct + func NewDummyMigration(version uint64) *DummyMigration + func (dm *DummyMigration) Down() error + func (dm *DummyMigration) Up() error + func (dm *DummyMigration) Version() uint64 + type GenericRegistry struct + func NewGenericRegistry() *GenericRegistry + func (registry *GenericRegistry) Count() int + func (registry *GenericRegistry) Get(version uint64) Migration + func (registry *GenericRegistry) OrderedMigrations() []Migration + func (registry *GenericRegistry) OrderedVersions() []uint64 + func (registry *GenericRegistry) Register(migration Migration) error + type Migration interface + Down func() error + Up func() error + Version func() uint64 + type MigrationsDirPath string + func NewMigrationsDirPath(dirPath string) (MigrationsDirPath, error) + type MigrationsRegistry interface + Count func() int + Get func(version uint64) Migration + OrderedMigrations func() []Migration + OrderedVersions func() []uint64 + Register func(migration Migration) error