Expand description
Schema migration types and traits.
The migration subsystem lets compiled #[derive(Table)] schemas evolve
across releases without manual stable-memory surgery. The flow is:
- On boot, the DBMS compares the hash of every compiled
TableSchemaSnapshotagainst the hash stored in the schema registry. - If they differ, the DBMS enters drift state and refuses CRUD.
- The user calls
Dbms::migrate(policy), which diffs the stored snapshots against the compiled ones and produces aVec<MigrationOp>. - The ops are applied transactionally; on success the new snapshots and schema hash are persisted and the drift flag is cleared.
This module owns the types (MigrationOp, ColumnChanges,
MigrationPolicy, MigrationError) and the per-table extension hook
Migrate. The diff algorithm and apply logic live in the engine crate.
Structs§
- Column
Changes - Bundle of constraint-flag deltas for an
MigrationOp::AlterColumn. - Migration
Policy - Caller-supplied policy that gates destructive migration ops.
Enums§
- Migration
Error - Error variants produced by the migration planner and apply pipeline.
- Migration
Op - Single atomic step produced by the migration planner.
Traits§
- Migrate
- Per-table extension hook for schema migrations.