pub trait Adapter {
type MigrationType: Migration + ?Sized;
type Error: Error + 'static;
fn applied_migrations(&mut self) -> Result<HashSet<Uuid>, Self::Error>;
fn apply_migration(
&mut self,
_: &Self::MigrationType
) -> Result<(), Self::Error>;
fn revert_migration(
&mut self,
_: &Self::MigrationType
) -> Result<(), Self::Error>;
}
Expand description
Trait necessary to adapt schemer’s migration management to a stateful backend.
Required Associated Types
type MigrationType: Migration + ?Sized
type MigrationType: Migration + ?Sized
Type migrations must implement for this adapter.
Required Methods
Returns the set of IDs for migrations that have been applied.
fn apply_migration(&mut self, _: &Self::MigrationType) -> Result<(), Self::Error>
fn apply_migration(&mut self, _: &Self::MigrationType) -> Result<(), Self::Error>
Apply a single migration.
fn revert_migration(
&mut self,
_: &Self::MigrationType
) -> Result<(), Self::Error>
fn revert_migration(
&mut self,
_: &Self::MigrationType
) -> Result<(), Self::Error>
Revert a single migration.