pub trait Operation<DB, State = ()>: Send + Sync
where DB: Database, State: Send + Sync,
{ // Required method fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, state: &'life2 State ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided methods fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, state: &'life2 State ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn is_destructible(&self) -> bool { ... } }
Expand description

Trait for operation

Required Methods§

source

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, state: &'life2 State ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Up command to be executed during migration apply

Provided Methods§

source

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, state: &'life2 State ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: '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 through cli. By default up operation are false. Down operation are always destructible and cannot be changed

Implementations on Foreign Types§

source§

impl<U, D> Operation<Any> for (U, D)
where U: AsRef<str> + Send + Sync, D: AsRef<str> + Send + Sync,

Available on (crate features postgres or mysql or sqlite) and crate feature any only.
source§

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut AnyConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut AnyConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl<U, D> Operation<MySql> for (U, D)
where U: AsRef<str> + Send + Sync, D: AsRef<str> + Send + Sync,

Available on crate feature mysql only.
source§

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut MySqlConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut MySqlConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl<U, D> Operation<Postgres> for (U, D)
where U: AsRef<str> + Send + Sync, D: AsRef<str> + Send + Sync,

Available on crate feature postgres only.
source§

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut PgConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut PgConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl<U, D> Operation<Sqlite> for (U, D)
where U: AsRef<str> + Send + Sync, D: AsRef<str> + Send + Sync,

Available on crate feature sqlite only.
source§

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut SqliteConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, connection: &'life1 mut SqliteConnection, _state: &'life2 () ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§