Struct schemer::Migrator
[−]
[src]
pub struct Migrator<T: Adapter> { /* fields omitted */ }
Primary schemer type for defining and applying migrations.
Methods
impl<T: Adapter> Migrator<T>
[src]
fn new(adapter: T) -> Migrator<T>
[src]
Create a Migrator
using the given Adapter
.
fn register(
&mut self,
migration: Box<T::MigrationType>
) -> Result<(), MigratorError<T::Error>>
[src]
&mut self,
migration: Box<T::MigrationType>
) -> Result<(), MigratorError<T::Error>>
Register a migration into the dependency graph.
fn up(&mut self, to: Option<Uuid>) -> Result<(), MigratorError<T::Error>>
[src]
Apply migrations as necessary to so that the specified migration is applied (inclusive).
If to
is None
, apply all registered migrations.
fn down(&mut self, to: Option<Uuid>) -> Result<(), MigratorError<T::Error>>
[src]
Revert migrations as necessary so that no migrations dependent on the specified migration are applied. If the specified migration was already applied, it will still be applied.
If to
is None
, revert all applied migrations.