pub struct MigrationMeta {
pub version: i64,
pub name: &'static str,
pub idempotent: bool,
pub reversible: bool,
pub data_loss_risk: DataLossRisk,
}Expand description
Per-migration metadata record.
Fields§
§version: i64Target schema version this migration produces (i.e. the
CURRENT_SCHEMA_VERSION value reached AFTER it runs).
name: &'static strShort human-readable name. Convention: SCREAMING_SNAKE
summarising the schema delta (e.g. ADD_TIER,
FEDERATION_NONCES).
idempotent: booltrue when re-running the migration against an already-
at-target DB is a no-op (uses CREATE ... IF NOT EXISTS,
ALTER TABLE ... ADD COLUMN IF NOT EXISTS shapes, or
per-row UPDATE WHERE-clauses that match nothing on a
second pass).
reversible: booltrue when the migration can be reverted purely by lowering
the schema_version row (no data was destroyed, no table
was dropped, no UPDATE clobbered a column the prior
schema needed).
data_loss_risk: DataLossRiskData-loss class on revert. See DataLossRisk.
Trait Implementations§
Source§impl Clone for MigrationMeta
impl Clone for MigrationMeta
Source§fn clone(&self) -> MigrationMeta
fn clone(&self) -> MigrationMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MigrationMeta
Auto Trait Implementations§
impl Freeze for MigrationMeta
impl RefUnwindSafe for MigrationMeta
impl Send for MigrationMeta
impl Sync for MigrationMeta
impl Unpin for MigrationMeta
impl UnsafeUnpin for MigrationMeta
impl UnwindSafe for MigrationMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more