pub struct Migration { /* private fields */ }Expand description
One ordered, reversible database migration.
Implementations§
Source§impl Migration
impl Migration
Sourcepub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
Define a migration with a stable, sortable ID and human-readable name.
Sourcepub fn up(self, statement: impl Into<String>) -> Self
pub fn up(self, statement: impl Into<String>) -> Self
Append one backend-compatible statement to the up direction.
Sourcepub fn down(self, statement: impl Into<String>) -> Self
pub fn down(self, statement: impl Into<String>) -> Self
Append one statement to the down direction.
Sourcepub fn irreversible(self) -> Self
pub fn irreversible(self) -> Self
Mark this migration as intentionally irreversible.
Trait Implementations§
impl Eq for Migration
impl StructuralPartialEq for Migration
Auto Trait Implementations§
impl Freeze for Migration
impl RefUnwindSafe for Migration
impl Send for Migration
impl Sync for Migration
impl Unpin for Migration
impl UnsafeUnpin for Migration
impl UnwindSafe for Migration
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> 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.