Skip to content


import ""


type Migration

type Migration struct {
    // contains filtered or unexported fields
Migration utility that handles migration logic.

func New

func New(repo rel.Repository) Migration
New migration manager.

func (*Migration) Instrumentation

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

func (*Migration) Migrate

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

func (*Migration) Register

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

func (*Migration) Rollback

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

Last update: 2022-06-25