pub trait MigrationStateManager {
    // Required methods
    fn prepare<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lowest_version<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Option<MigrationState>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn highest_version<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Option<MigrationState>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_versions<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MigrationState>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn begin_version<'life0, 'async_trait>(
        &'life0 self,
        version: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finish_version<'life0, 'async_trait>(
        &'life0 self,
        version: u32
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for state management

This should be implemented by DB drivers so that db-up can manage installed schema versions.

Required Methods§

source

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

Prepare the DB for migration state management

This will be called before any other methods to ensure that the dateabase is prepared for state management. For most drivers, this method will simply ensure that a state management table exists.

source

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

Get the lowest deployed version

source

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

Get the highest deployed version

source

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

Get a list of all deployed versions

source

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

Begin a new version

source

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

Finish a new version

This will usually just set the status of the migration version to Deployed

Implementors§