Skip to main content

Module migration

Module migration 

Source
Expand description

Purpose: Provide the public migration API surface and top-level orchestration.

Responsibilities:

  • Declare migration companion modules.
  • Re-export migration data models and context types.
  • Check, apply, and list migrations without owning leaf migration logic.

Scope:

  • Top-level orchestration only; type definitions live in types.rs, history persistence lives in history.rs, and leaf migration behavior lives in config_migrations/ and file_migrations/.

Usage:

  • Import migration helpers through crate::migration.
  • Internal modules may use the re-exported types or sibling companion modules.

Invariants/Assumptions:

  • Re-exports preserve existing caller imports.
  • Migrations remain idempotent and registry-driven.
  • Migration history is saved immediately after each successful apply.

Modules§

config_migrations
Purpose: Directory-backed facade for config migration helpers.
file_migrations
Purpose: Directory-backed facade for file migration helpers.
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.