migrationartifact

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package migrationartifact owns atomic, immutable migration artifact files.

Index

Constants

View Source
const Extension = ".ridu.json"

Extension distinguishes Ridu artifacts from arbitrary JSON.

Variables

This section is empty.

Functions

func LatestManifest

func LatestManifest(directory string) (schema.Manifest, bool, error)

LatestManifest returns the desired schema committed by the newest artifact.

Types

type File

type File struct {
	Path     string
	Name     string
	Digest   string
	Artifact migration.Artifact
}

File contains one parsed immutable migration and its filesystem identity.

func Create

func Create(directory, name string, artifact migration.Artifact, now time.Time) (File, error)

Create atomically creates one migration artifact and never overwrites an existing filename.

func ReadAll

func ReadAll(directory string) ([]File, error)

ReadAll parses, validates, and returns artifacts in lexical execution order.

func RequireCurrentHistory

func RequireCurrentHistory(directory string, executable schema.Manifest) ([]File, error)

RequireCurrentHistory proves that a deployable executable manifest is the exact head of a non-empty, immutable artifact history. An empty history is a valid input only to migration creation; release checks and database commands must fail closed until the initial artifact has been created and committed.

func RequireCurrentHistoryForPlanner

func RequireCurrentHistoryForPlanner(directory string, executable schema.Manifest, plannerName string) ([]File, error)

RequireCurrentHistoryForPlanner additionally proves that every immutable artifact belongs to the planner family selected by the project database. Adapter runners retain ownership of planner-version and exact-plan checks.

Jump to

Keyboard shortcuts

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