MigrationManager

Trait MigrationManager 

Source
pub trait MigrationManager<DB: Database>: Send + Sync {
    // Required methods
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn up<'life0, 'life1, 'async_trait>(
        &'life0 self,
        migrations: &'life1 [Box<dyn Migration<DB>>],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn down<'life0, 'life1, 'async_trait>(
        &'life0 self,
        migrations: &'life1 [Box<dyn Migration<DB>>],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_applied_migrations<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MigrationRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_applied<'life0, 'async_trait>(
        &'life0 self,
        version: i64,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn get_migration_table_name(&self) -> &str { ... }
}

Required Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize migration tracking table

Source

fn up<'life0, 'life1, 'async_trait>( &'life0 self, migrations: &'life1 [Box<dyn Migration<DB>>], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply pending migrations

Source

fn down<'life0, 'life1, 'async_trait>( &'life0 self, migrations: &'life1 [Box<dyn Migration<DB>>], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Rollback migrations

Source

fn get_applied_migrations<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<MigrationRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get list of applied migrations

Source

fn is_applied<'life0, 'async_trait>( &'life0 self, version: i64, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if specific migration was applied

Provided Methods§

Implementors§