mongodb_migrator/migrator/
mod.rs

1//! Migrator runs passed migrations - entities which implement [`Migration`] trait
2pub mod default;
3pub mod shell;
4pub mod with_connection;
5pub mod with_migrations_vec;
6pub mod with_shell_config;
7
8use mongodb::Database;
9
10use self::{
11    default::DefaultMigrator, shell::Shell, with_connection::WithConnection,
12    with_migrations_vec::WithMigrationsVec, with_shell_config::WithShellConfig,
13};
14
15pub enum Migrator {
16    DefaultMigrator(DefaultMigrator),
17    WithConnection(WithConnection),
18    WithMigrationsVec(WithMigrationsVec),
19    WithShellConfig(WithShellConfig),
20}
21
22#[derive(Clone)]
23pub struct Env {
24    pub db: Option<Database>,
25    pub shell: Option<Shell>,
26}
27
28impl Default for Env {
29    fn default() -> Self {
30        Self {
31            db: None,
32            shell: None,
33        }
34    }
35}