* Running atomic migration * refactor * clippy * visibility * Execute migration in transaction when it's a Postgres connection * Testing rolling back on migrate up and down * lifetimes elision * typo * abort migration before committing nested transaction
25 lines
847 B
Rust
25 lines
847 B
Rust
use sea_orm_migration::prelude::*;
|
|
|
|
mod m20220118_000001_create_cake_table;
|
|
mod m20220118_000002_create_fruit_table;
|
|
mod m20220118_000003_seed_cake_table;
|
|
mod m20220118_000004_create_tea_enum;
|
|
mod m20220923_000001_seed_cake_table;
|
|
mod m20230109_000001_seed_cake_table;
|
|
|
|
pub struct Migrator;
|
|
|
|
#[async_trait::async_trait]
|
|
impl MigratorTrait for Migrator {
|
|
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
|
|
vec![
|
|
Box::new(m20220118_000001_create_cake_table::Migration),
|
|
Box::new(m20220118_000002_create_fruit_table::Migration),
|
|
Box::new(m20220118_000003_seed_cake_table::Migration),
|
|
Box::new(m20220118_000004_create_tea_enum::Migration),
|
|
Box::new(m20220923_000001_seed_cake_table::Migration),
|
|
Box::new(m20230109_000001_seed_cake_table::Migration),
|
|
]
|
|
}
|
|
}
|