a3s_orm/migration/backend.rs
1use async_trait::async_trait;
2
3use super::{MigrationReport, PreparedMigration};
4
5/// Applies an already validated migration set.
6///
7/// Implementations must serialize concurrent migrators, verify previously
8/// applied checksums, and atomically record every migration they apply.
9#[async_trait]
10pub trait MigrationBackend: Send + Sync {
11 type Error: std::error::Error + Send + Sync + 'static;
12
13 async fn apply(&self, migrations: &[PreparedMigration])
14 -> Result<MigrationReport, Self::Error>;
15}