pub trait MigrationRollback {
// Required methods
async fn rollback_last_batch(&self) -> OrmResult<RollbackResult>;
async fn rollback_batch(&self, batch: i32) -> OrmResult<RollbackResult>;
async fn rollback_migration(&self, migration_id: &str) -> OrmResult<()>;
async fn rollback_all(&self) -> OrmResult<RollbackResult>;
async fn get_migrations_in_batch(
&self,
batch: i32,
) -> OrmResult<Vec<MigrationRecord>>;
}Expand description
Extension trait for MigrationRunner to add rollback functionality
Required Methods§
Sourceasync fn rollback_last_batch(&self) -> OrmResult<RollbackResult>
async fn rollback_last_batch(&self) -> OrmResult<RollbackResult>
Rollback the last batch of migrations
Sourceasync fn rollback_batch(&self, batch: i32) -> OrmResult<RollbackResult>
async fn rollback_batch(&self, batch: i32) -> OrmResult<RollbackResult>
Rollback all migrations in a specific batch
Sourceasync fn rollback_migration(&self, migration_id: &str) -> OrmResult<()>
async fn rollback_migration(&self, migration_id: &str) -> OrmResult<()>
Rollback a specific migration by ID
Sourceasync fn rollback_all(&self) -> OrmResult<RollbackResult>
async fn rollback_all(&self) -> OrmResult<RollbackResult>
Rollback all applied migrations
Sourceasync fn get_migrations_in_batch(
&self,
batch: i32,
) -> OrmResult<Vec<MigrationRecord>>
async fn get_migrations_in_batch( &self, batch: i32, ) -> OrmResult<Vec<MigrationRecord>>
Get migrations in a specific batch
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.