Documentation
¶
Index ¶
- Variables
- type Migrator
- func (migrator Migrator) Migrate() (Report, error)
- func (migrator Migrator) MigrateCurrentV2(ctx context.Context, expectedDigest string) (Report, error)
- func (migrator Migrator) MigrateExpected(expectedDigest string) (Report, error)
- func (migrator Migrator) Plan() (Plan, error)
- func (migrator Migrator) PlanCurrentV2() (Plan, error)
- type Plan
- type Report
Constants ¶
This section is empty.
Variables ¶
var ErrPendingRecovery = errors.New("old-schema pending recovery requires the corresponding previous SDK/binary; recover with it, then rerun migration dry-run and apply")
ErrPendingRecovery identifies persisted old-schema receipts and native intents that must be recovered with the corresponding previous SDK or binary.
var ErrPlanChanged = errors.New("state changed after review; rerun migrate-state --dry-run")
ErrPlanChanged refuses a migration whose reviewed bytes are no longer live.
Functions ¶
This section is empty.
Types ¶
type Migrator ¶
type Migrator struct {
LegacyPath string
V2Store statev2.Store
Now func() time.Time
NewID func() (string, error)
Lock ports.MutationLock
// PendingCheck is strictly read-only. It refuses when any old-schema journal,
// receipt or native intent needs the matching previous SDK or binary.
PendingCheck func(context.Context) error
}
func (Migrator) MigrateCurrentV2 ¶
func (migrator Migrator) MigrateCurrentV2(ctx context.Context, expectedDigest string) (Report, error)
MigrateCurrentV2 performs the explicit schema 2-4 -> current migration in place. It is intentionally separate from MigrateExpected, which migrates the pre-v2 legacy store into a new authoritative file.
func (Migrator) MigrateExpected ¶
func (Migrator) PlanCurrentV2 ¶
PlanCurrentV2 inspects authoritative schemas 2-4 without writing them. The digest is the token the apply step must recheck under the global mutation lock.