Documentation
¶
Overview ¶
Package upgrade implements the "admin upgrade" command, which migrates the nitpicking database from v1 to v2 schema. The migration converts claimed-state issues to open, removes obsolete history event types, and records the new schema version — all in a single atomic transaction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmd ¶
NewCmd constructs the "admin upgrade" command, which checks the database schema version and applies the v1→v2 migration when needed. An optional runFn parameter replaces the default Run for testing; when injected, the service is not constructed and the runFn receives only the IOStreams fields of RunInput (Svc is nil).
Types ¶
type RunInput ¶
type RunInput struct {
// Svc is the application service through which schema migration operations
// are invoked. The upgrade command never imports a concrete storage adapter;
// all migration capability is accessed via this driving port interface.
Svc driving.Service
// JSONOutput requests machine-readable JSON output when true.
JSONOutput bool
// Out receives the human-readable or JSON output.
Out io.Writer
// ColorScheme provides terminal colour helpers for human-readable output.
ColorScheme *iostreams.ColorScheme
}
RunInput holds all parameters for the upgrade command's core logic, decoupled from CLI flag parsing so it can be tested directly.