Trait Info

Source
pub trait Info<DB> {
    // Required methods
    fn migrations(&self) -> &Vec<Box<dyn Migration<DB>>>;
    fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB>>>;

    // Provided methods
    fn add_migrations(
        &mut self,
        migrations: Vec<Box<dyn Migration<DB>>>,
    ) -> Result<(), Error> { ... }
    fn add_migration(
        &mut self,
        migration: Box<dyn Migration<DB>>,
    ) -> Result<(), Error> { ... }
}
Expand description

The Info trait provides database-agnostic methods for managing migrations and interacting with migration states.

Required Methods§

Source

fn migrations(&self) -> &Vec<Box<dyn Migration<DB>>>

Returns a reference to the list of migrations.

Source

fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB>>>

Returns a mutable reference to the list of migrations.

Provided Methods§

Source

fn add_migrations( &mut self, migrations: Vec<Box<dyn Migration<DB>>>, ) -> Result<(), Error>

Adds a list of migrations to the migrator.

This method accepts a vector of migrations and adds each one individually to ensure proper handling of migration relationships and duplicates.

§Errors

If migration is added with same app and name but inconsistent value i.e its parents, run before, replaces and is atomic differ and do not have same number of operation

Source

fn add_migration( &mut self, migration: Box<dyn Migration<DB>>, ) -> Result<(), Error>

Adds a single migration to the migrator.

§Errors

If migration is added with same app and name but inconsistent value i.e its parents, run before, replaces and is atomic differ and do not have same number of operation

Implementors§

Source§

impl<DB> Info<DB> for Migrator<DB>