pub struct SchemaMigrationPlan { /* private fields */ }Expand description
One canonical database-scoped coordinated migration plan.
Implementations§
Source§impl SchemaMigrationPlan
impl SchemaMigrationPlan
Sourcepub fn try_new(
transitions: Vec<EntityMigration>,
) -> Result<Self, SchemaContractError>
pub fn try_new( transitions: Vec<EntityMigration>, ) -> Result<Self, SchemaContractError>
Construct, canonicalize, bound, and digest one coordinated plan.
§Errors
Returns a typed migration or encoded-size error for an empty, duplicate, ambiguous, or oversized plan.
Sourcepub fn validate_target_fragment(
&self,
fragment: &SchemaFragment,
) -> Result<(), SchemaContractError>
pub fn validate_target_fragment( &self, fragment: &SchemaFragment, ) -> Result<(), SchemaContractError>
Validate a complete authored target fragment against this migration plan.
Uses the proposal’s source-reference, closure and version rules without requiring runtime database identities, stores or an accepted head. This does not qualify the predecessor’s retained data or authorize migration.
§Errors
Returns the proposal contract error for malformed inputs, missing target definitions, version gaps, or invalid rename/transform targets.
Sourcepub const fn program_version(&self) -> u16
pub const fn program_version(&self) -> u16
Return the closed migration-program version.
Sourcepub fn transitions(&self) -> &[EntityMigration]
pub fn transitions(&self) -> &[EntityMigration]
Borrow canonical entity transitions.
Sourcepub const fn digest(&self) -> SchemaMigrationPlanDigest
pub const fn digest(&self) -> SchemaMigrationPlanDigest
Return the exact canonical plan digest.