pub enum MigrationType {
Simple,
ReversibleUp,
ReversibleDown,
}Available on crate feature
migrate only.Expand description
Migration Type represents the type of migration
Variantsยง
Simple
Simple migration are single file migrations with no up / down queries
ReversibleUp
ReversibleUp migrations represents the add or update part of a reversible migrations It is expected the every migration of this type will have a corresponding down file
ReversibleDown
ReversibleDown migrations represents the delete or downgrade part of a reversible migrations It is expected the every migration of this type will have a corresponding up file
Implementationsยง
Sourceยงimpl MigrationType
impl MigrationType
pub fn from_filename(filename: &str) -> MigrationType
pub fn is_reversible(&self) -> bool
pub fn is_up_migration(&self) -> bool
pub fn is_down_migration(&self) -> bool
pub fn label(&self) -> &'static str
pub fn suffix(&self) -> &'static str
pub fn file_content(&self) -> &'static str
pub fn infer(migrator: &Migrator, reversible: bool) -> MigrationType
๐Deprecated:
unused
Trait Implementationsยง
Sourceยงimpl Clone for MigrationType
impl Clone for MigrationType
Sourceยงfn clone(&self) -> MigrationType
fn clone(&self) -> MigrationType
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 moreSourceยงimpl Debug for MigrationType
impl Debug for MigrationType
Sourceยงimpl Ord for MigrationType
impl Ord for MigrationType
Sourceยงfn cmp(&self, other: &MigrationType) -> Ordering
fn cmp(&self, other: &MigrationType) -> Ordering
1.21.0 (const: unstable) ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Sourceยงimpl PartialEq for MigrationType
impl PartialEq for MigrationType
Sourceยงfn eq(&self, other: &MigrationType) -> bool
fn eq(&self, other: &MigrationType) -> bool
Tests for
self and other values to be equal, and is used by ==.Sourceยงimpl PartialOrd for MigrationType
impl PartialOrd for MigrationType
impl Copy for MigrationType
impl Eq for MigrationType
impl StructuralPartialEq for MigrationType
Auto Trait Implementationsยง
impl Freeze for MigrationType
impl RefUnwindSafe for MigrationType
impl Send for MigrationType
impl Sync for MigrationType
impl Unpin for MigrationType
impl UnsafeUnpin for MigrationType
impl UnwindSafe for MigrationType
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,
Sourceยงimpl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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