Documentation
¶
Overview ¶
Package migrationartifact owns atomic, immutable migration artifact files.
Index ¶
- Constants
- func LatestManifest(directory string) (schema.Manifest, bool, error)
- type File
- func Create(directory, name string, artifact migration.Artifact, now time.Time) (File, error)
- func ReadAll(directory string) ([]File, error)
- func RequireCurrentHistory(directory string, executable schema.Manifest) ([]File, error)
- func RequireCurrentHistoryForPlanner(directory string, executable schema.Manifest, plannerName string) ([]File, error)
Constants ¶
const Extension = ".ridu.json"
Extension distinguishes Ridu artifacts from arbitrary JSON.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
File contains one parsed immutable migration and its filesystem identity.
func Create ¶
Create atomically creates one migration artifact and never overwrites an existing filename.
func RequireCurrentHistory ¶
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.