Documentation
¶
Index ¶
Constants ¶
View Source
const (
MIGRATION_TABLE_NAME = "_migrations"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrationEntity ¶
type MigrationsRepository ¶
type MigrationsRepository interface {
CreateTable() error
GetAppliedMigrations() ([]MigrationEntity, error)
SaveMigrationStatus(migration MigrationEntity) error
}
type SqlMigrationService ¶
type SqlMigrationService struct {
Context context.Context
Migrations *orderedmap.OrderedMap[int, Migration]
AppliedMigrations []MigrationEntity
Repository MigrationsRepository
// contains filtered or unexported fields
}
func NewMigrationService ¶
func NewMigrationService(repo MigrationsRepository) *SqlMigrationService
func (*SqlMigrationService) Register ¶
func (m *SqlMigrationService) Register(migration Migration)
func (*SqlMigrationService) Run ¶
func (m *SqlMigrationService) Run() error
func (*SqlMigrationService) WasApplied ¶
func (m *SqlMigrationService) WasApplied(name string) bool
Click to show internal directories.
Click to hide internal directories.