pub trait Migration{
type Ctx: MigrationContext;
// Required methods
fn migration_id(&self) -> MigrationId;
fn content(&self) -> String;
fn no_tx(&self) -> bool;
fn build<'a>(
&'a self,
ctx: &'a mut Self::Ctx,
) -> BoxFuture<'a, TernResult<Query>>;
// Provided methods
fn version(&self) -> i64 { ... }
fn to_applied(
&self,
duration_ms: i64,
applied_at: DateTime<Utc>,
) -> AppliedMigration { ... }
}
Expand description
A single migration in a migration set.
Required Associated Types§
Sourcetype Ctx: MigrationContext
type Ctx: MigrationContext
A migration context that is sufficient to build this migration.
Required Methods§
Sourcefn migration_id(&self) -> MigrationId
fn migration_id(&self) -> MigrationId
Get the MigrationId
for this migration.
Provided Methods§
Sourcefn to_applied(
&self,
duration_ms: i64,
applied_at: DateTime<Utc>,
) -> AppliedMigration
fn to_applied( &self, duration_ms: i64, applied_at: DateTime<Utc>, ) -> AppliedMigration
Convert this migration to an AppliedMigration
assuming that it was
successfully applied.