1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Operation module
//!
//! To create own operation implement trait for type
//!
//! ### Example
//!
//! ```rust,no_run
//! use sqlx_migrator::error::Error;
//! use sqlx_migrator::operation::OperationTrait;
//! use sqlx_migrator::sqlx::Sqlite;
//!
//! struct ExampleOperation;
//! #[async_trait::async_trait]
//! impl OperationTrait<Sqlite> for ExampleOperation {
//! async fn up(&self, connection: &mut sqlx::SqliteConnection) -> Result<(), Error> {
//! // Do some operations
//! Ok(())
//! }
//!
//! // By default operation is irreversible and cannot be reversed if you want to support
//! // reverse of migration than add down function as well
//! async fn down(&self, connection: &mut sqlx::SqliteConnection) -> Result<(), Error> {
//! // Do some operations
//! Ok(())
//! }
//! }
//! ```
use crate Error;
/// Trait for operation