Skip to main content

Module migration

Module migration 

Source
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.
MigrationContext
Context for migration operations.
MigrationStatus
Status of a migration for display.

Enums§

MigrationCheckResult
Result of checking migration status.
MigrationType
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.