migrations

package
v0.60.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrationFunc

type MigrationFunc func(map[string]any) (map[string]any, error)

MigrationFunc transforms a content payload between schema versions.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores content type schema migrations and exposes a runner.

func NewRegistry

func NewRegistry() *Registry

NewRegistry constructs an empty content schema migration registry.

func (*Registry) Migrate

func (r *Registry) Migrate(slug, from, to string, payload map[string]any) (map[string]any, error)

Migrate applies registered migration steps.

func (*Registry) Migrator

func (r *Registry) Migrator() *cmsschema.Migrator

Migrator returns the underlying migrator runner.

func (*Registry) Register

func (r *Registry) Register(slug, from, to string, fn MigrationFunc) error

Register adds a migration step for a content type schema version.

Jump to

Keyboard shortcuts

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