Expand description
Migration system for config and project file changes.
Responsibilities:
- Track and apply migrations for config key renames/removals, file format changes, and README updates.
- Provide a registry-based system for defining migrations with unique IDs.
- Support safe migration with backup/rollback capability.
- Preserve JSONC comments when modifying config files.
Not handled here:
- Direct file I/O for migration history (see
history.rs). - Config key rename implementation details (see
config_migrations.rs). - File migration implementation details (see
file_migrations.rs).
Invariants/assumptions:
- Migrations are idempotent: running the same migration twice is a no-op.
- Migration history is stored in
.ralph/cache/migrations.jsonc. - All migrations have a unique ID and are tracked in the registry.
Modules§
- config_
migrations - Config key migration utilities for rename/remove operations.
- file_
migrations - File migration utilities for renaming/moving files.
- history
- Migration history persistence for tracking applied migrations.
- registry
- Migration registry containing all defined migrations.
Structs§
- Migration
- A single migration definition.
- Migration
Context - Context for migration operations.
- Migration
Status - Status of a migration for display.
Enums§
- Migration
Check Result - Result of checking migration status.
- Migration
Type - Types of migrations supported.
Functions§
- apply_
all_ migrations - Apply all pending migrations.
- apply_
migration - Apply a single migration.
- check_
migrations - Check for pending migrations without applying them.
- list_
migrations - List all migrations with their status.