pub struct Migration { /* private fields */ }
Expand description
Represents a schema migration to be run on the database,
this struct is used by the embed_migrations!
macro to gather migration files
and shouldn’t be needed by the user
Implementations§
Source§impl Migration
impl Migration
Sourcepub fn unapplied(input_name: &str, sql: &str) -> Result<Migration, Error>
pub fn unapplied(input_name: &str, sql: &str) -> Result<Migration, Error>
Create an unapplied migration, name and version are parsed from the input_name, which must be named in the format (U|V){1}__{2}.rs where {1} represents the migration version and {2} the name.
pub fn applied( version: i32, name: String, applied_on: OffsetDateTime, checksum: u64, ) -> Migration
pub fn set_applied(&mut self)
pub fn sql(&self) -> Option<&str>
Sourcepub fn applied_on(&self) -> Option<&OffsetDateTime>
pub fn applied_on(&self) -> Option<&OffsetDateTime>
Get the timestamp from when the Migration was applied. None
when unapplied.
Migrations returned from Runner::get_migrations() will always have None
.
Trait Implementations§
Source§impl Ord for Migration
impl Ord for Migration
Source§impl PartialOrd for Migration
impl PartialOrd for Migration
impl Eq 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 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> 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§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.