pub trait Migration: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn up<'a>(
&'a self,
schema: &'a Schema<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
fn down<'a>(
&'a self,
schema: &'a Schema<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}Expand description
One migration.
name must be unique and sortable — the generator produces
2026_08_29_000001_create_users_table, so lexical order is time order.
Required Methods§
fn name(&self) -> &'static str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".