pub trait Migrates: RelationalBackend {
// Required methods
fn migrate(
&self,
migrations: &[Migration],
) -> impl Future<Output = Result<MigrateReport, MigrateError>> + Send;
fn applied_versions(
&self,
) -> impl Future<Output = Result<Vec<i64>, MigrateError>> + Send;
}Expand description
A relational backend that keeps a migration ledger.
The ledger lives in the connection’s current schema (or database): point this at a database a program owns, never at one whose ledger belongs to something else.
Required Methods§
Sourcefn migrate(
&self,
migrations: &[Migration],
) -> impl Future<Output = Result<MigrateReport, MigrateError>> + Send
fn migrate( &self, migrations: &[Migration], ) -> impl Future<Output = Result<MigrateReport, MigrateError>> + Send
Apply migrations in version order, skipping those already applied. Each migration runs in
its own transaction where the database can; refuses (applying nothing further) if an applied
migration’s text has changed, if the database has applied a version the program does not
know, or if a migration is recorded as dirty.
Sourcefn applied_versions(
&self,
) -> impl Future<Output = Result<Vec<i64>, MigrateError>> + Send
fn applied_versions( &self, ) -> impl Future<Output = Result<Vec<i64>, MigrateError>> + Send
The versions the ledger says succeeded, ascending; empty if there is no ledger yet.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".