pub trait Operation<DB>: Send + Sync
where 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§

source

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§

source

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.

source

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

Implementors§