pub trait Migration: Send + Sync {
// Required methods
fn name(&self) -> &str;
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;
// Provided method
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 { ... }
}Expand description
One migration: a stable name, an up, and an optional down.
Required Methods§
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".