Trait db_up::MigrationStateManager
source · 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§
sourcefn prepare<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
sourcefn 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 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
sourcefn 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 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
sourcefn 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 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