pub struct SqlMigration { /* private fields */ }Expand description
A migration whose up and down are raw SQL strings. down is optional; its
absence makes the migration irreversible.
Implementations§
Trait Implementations§
Source§impl Migration for SqlMigration
impl Migration for SqlMigration
Source§fn name(&self) -> &str
fn name(&self) -> &str
The stable name recorded in the tracking table. Never change it once the
migration has shipped.
Source§fn up<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
schema: &'life1 mut Schema<'life2>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn up<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
schema: &'life1 mut Schema<'life2>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Applies the migration.
Source§fn down<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
schema: &'life1 mut Schema<'life2>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn down<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
schema: &'life1 mut Schema<'life2>,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Reverses the migration. The default marks it irreversible; the runner
fills in the module id. Override to make a migration reversible.
Auto Trait Implementations§
impl Freeze for SqlMigration
impl RefUnwindSafe for SqlMigration
impl Send for SqlMigration
impl Sync for SqlMigration
impl Unpin for SqlMigration
impl UnsafeUnpin for SqlMigration
impl UnwindSafe for SqlMigration
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> 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