pub trait Migration: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn scope(&self) -> MigrationScope;
fn description(&self) -> &'static str;
fn up(&self, ctx: &MigrationContext) -> Result<(), MigrationError>;
// Provided method
fn verify(&self, _ctx: &MigrationContext) -> VerifyOutcome { ... }
}Required Methods§
fn id(&self) -> &'static str
fn scope(&self) -> MigrationScope
fn description(&self) -> &'static str
fn up(&self, ctx: &MigrationContext) -> Result<(), MigrationError>
Provided Methods§
Sourcefn verify(&self, _ctx: &MigrationContext) -> VerifyOutcome
fn verify(&self, _ctx: &MigrationContext) -> VerifyOutcome
Post-condition check for an APPLIED migration. Must be read-only and
cheap (a handful of queries / exists() calls) — it runs from a CLI
doctor pass, never from startup. Default: nothing checkable. Override
where the effect can be stated as a query; see m0007 for the
row-count shape and m0002 for the marker-file shape.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".