migration

package
v0.0.0-...-860e413 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, es *eventstore.Eventstore, migration Migration) (err error)

func RegisterMappers

func RegisterMappers(es *eventstore.Eventstore)

func SetupMapper

func SetupMapper(event *repository.Event) (eventstore.Event, error)

Types

type Migration

type Migration interface {
	String() string
	Execute(context.Context) error
}

type RepeatableMigration

type RepeatableMigration interface {
	Migration
	SetLastExecution(lastRun map[string]interface{})
	Check() bool
}

type SetupStep

type SetupStep struct {
	eventstore.BaseEvent `json:"-"`

	Name    string      `json:"name"`
	Error   error       `json:"error,omitempty"`
	LastRun interface{} `json:"lastRun,omitempty"`
	// contains filtered or unexported fields
}

SetupStep is the command pushed on the eventstore

func (*SetupStep) Data

func (s *SetupStep) Data() interface{}

func (*SetupStep) UniqueConstraints

func (s *SetupStep) UniqueConstraints() []*eventstore.EventUniqueConstraint

func (*SetupStep) UnmarshalJSON

func (s *SetupStep) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL