Trait sqlx_migrator::operation::Operation
source · pub trait Operation<DB>: Send + Syncwhere
DB: Database,{
// Required method
fn up<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn down<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn is_destructible(&self) -> bool { ... }
}Expand description
Trait for operation
Required Methods§
sourcefn up<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn up<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Up command to be executed during migration apply
Provided Methods§
sourcefn down<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn down<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 mut <DB as Database>::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Down command to be executed during migration rollback. If it is not implemented than operation is irreversible operation.
sourcefn is_destructible(&self) -> bool
fn is_destructible(&self) -> bool
Whether up operation is destructible or not. If operation is destructible than user should answer before running migration. By default up operation are false. Down operation are always destructible by default and it cannot be changed