pub enum MigrationStep {
Sql(Cow<'static, str>),
Run(Box<dyn Fn(&Connection) -> Result<(), DbError> + Sync + Send>),
}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> + Sync + Send>)
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.