Documentation
¶
Index ¶
- func Register(m *Migration)
- func RegisteredCount() int
- func Reset()
- type Migration
- type Migrator
- func (m *Migrator) Down(ctx context.Context, steps int) error
- func (m *Migrator) GetApplied(ctx context.Context) (map[string]bool, error)
- func (m *Migrator) Init(ctx context.Context) error
- func (m *Migrator) Up(ctx context.Context, steps int) error
- func (m *Migrator) UpDryRun(ctx context.Context, steps int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisteredCount ¶ added in v1.2.2
func RegisteredCount() int
RegisteredCount reports how many migrations are registered in this binary. The CLI uses it to refuse a no-op `migrate up`/`down`: a standalone binary that never imported the project's migrations package has an empty registry, and "No pending migrations" there would be a lie.
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func (*Migrator) GetApplied ¶
Click to show internal directories.
Click to hide internal directories.