pub enum MigrationType {
Simple,
ReversibleUp,
ReversibleDown,
}
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) -> Self
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
Trait Implementations§
source§impl Clone for MigrationType
impl Clone for MigrationType
source§fn clone(&self) -> MigrationType
fn clone(&self) -> MigrationType
Returns a copy of the value. Read more
1.0.0 · 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 PartialEq for MigrationType
impl PartialEq for MigrationType
impl Copy 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 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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