Skip to content

migrator

import "github.com/go-rel/rel/migrator"

Overview

type Migrator

type Migrator struct {
    // contains filtered or unexported fields
}
Migrator is a migration manager that handles migration logic.

func New

func New(repo rel.Repository) Migrator
New migrationr.

func (*Migrator) Instrumentation

func (m *Migrator) Instrumentation(instrumenter rel.Instrumenter)
Instrumentation function.

func (*Migrator) Migrate

func (m *Migrator) Migrate(ctx context.Context)
Migrate to the latest schema version.

func (*Migrator) Register

func (m *Migrator) Register(v int, up func(schema *rel.Schema), down func(schema *rel.Schema))
Register a migration.

func (*Migrator) Rollback

func (m *Migrator) Rollback(ctx context.Context)
Rollback migration 1 step.


Last update: 2022-02-20