Help us shape the future of Go! Take the 2026 Go Developer Survey

migrator

package
v0.0.0-...-f80edc0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCoreAuthorityConflict = errors.New("core database authority conflicts with the Host ownership boundary")
View Source
var ErrCoreUpgradeIncompatible = errors.New("core upgrade is incompatible with an enabled raw database extension")
View Source
var ErrOnlineMigrationUnsafe = errors.New("pending migrations are not safe for an online update")

Functions

func IsUpToDate

func IsUpToDate(ctx context.Context, cfg Config) (bool, error)

IsUpToDate performs a read-only schema check for zero-downtime releases. Both Core and River migrations must exactly match the target binary; callers must fall back to the maintenance-window deploy path when this returns false.

func Up

func Up(ctx context.Context, cfg Config) error

Types

type Config

type Config struct {
	DatabaseURL string
	Logger      *slog.Logger
	// TargetCoreVersion pins the Core version this run migrates to. Leave it
	// empty to derive it from the build identity; that derivation also reports
	// whether the value is a real declaration or the untagged-development
	// fallback sentinel.
	TargetCoreVersion string
}

type OnlineMigrationPlan

type OnlineMigrationPlan struct {
	PendingCore []string
}

func CheckOnlineSafe

func CheckOnlineSafe(ctx context.Context, cfg Config) (OnlineMigrationPlan, error)

CheckOnlineSafe permits only explicitly declared, backward-compatible Core migrations. River must already match because its internal migrations do not carry SForum's old/new binary compatibility declaration.

func (OnlineMigrationPlan) RequiresMigration

func (plan OnlineMigrationPlan) RequiresMigration() bool

Jump to

Keyboard shortcuts

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