Documentation
¶
Index ¶
- type Config
- type Migration
- type Migrator
- func (m *Migrator) AddMigration(migration *Migration)
- func (m *Migrator) AddMigrations(steps ...*Migration) []*Migration
- func (m *Migrator) CurrentVersion(ctx context.Context) (int64, error)
- func (m *Migrator) Len() int64
- func (m *Migrator) Reset(ctx context.Context) (int64, error)
- func (m *Migrator) Rollback(ctx context.Context) (int64, error)
- func (m *Migrator) RollbackTo(ctx context.Context, targetVersion int64) (int64, error)
- func (m *Migrator) Run(ctx context.Context) (int64, error)
- func (m *Migrator) RunAllTests(t *testing.T)
- func (m *Migrator) RunDownTests(t *testing.T)
- func (m *Migrator) RunUpTests(t *testing.T)
- func (m *Migrator) Step(ctx context.Context, db *sql.DB) (int64, error)
- func (m *Migrator) StepTo(ctx context.Context, targetVersion int64) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Migration ¶
type Migration struct {
Name string
Deprecated bool
Up string
UpFn func(context.Context, *sql.DB) error
UpTest func(context.Context, *sql.DB, *testing.T)
Down string
DownFn func(context.Context, *sql.DB) error
DownTest func(context.Context, *sql.DB, *testing.T)
// contains filtered or unexported fields
}
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func (*Migrator) AddMigration ¶
func (*Migrator) AddMigrations ¶
func (*Migrator) CurrentVersion ¶
func (*Migrator) RollbackTo ¶
func (*Migrator) RunAllTests ¶
func (*Migrator) RunDownTests ¶
func (*Migrator) RunUpTests ¶
Click to show internal directories.
Click to hide internal directories.