pub enum MigrationStep {
Sql(Cow<'static, str>),
Run(Box<dyn Fn(&Connection) -> Result<(), DbError> + Send + Sync>),
}Expand description
How a migration applies its change to the synced schema.
Variants§
Sql(Cow<'static, str>)
A DDL batch (CREATE / ALTER / CREATE INDEX), e.g. include_str! of a
.sql file.
Run(Box<dyn Fn(&Connection) -> Result<(), DbError> + Send + Sync>)
Table rebuilds and backfills that DDL alone cannot express. Invoked at most
once (only when its version is above the on-disk one). All pending steps
share the open transaction, so a failed step or routing validation rolls
the full ladder back with user_version.
Auto Trait Implementations§
impl Freeze for MigrationStep
impl !RefUnwindSafe for MigrationStep
impl Send for MigrationStep
impl Sync for MigrationStep
impl Unpin for MigrationStep
impl UnsafeUnpin for MigrationStep
impl !UnwindSafe for MigrationStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more