Trait sqlx_migrator::migrator::Info
source · pub trait Info<DB, State> {
// Required methods
fn state(&self) -> &State;
fn migrations(&self) -> &Vec<Box<dyn Migration<DB, State>>>;
fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB, State>>>;
// Provided methods
fn add_migrations(&mut self, migrations: Vec<Box<dyn Migration<DB, State>>>) { ... }
fn add_migration(&mut self, migration: Box<dyn Migration<DB, State>>) { ... }
}
Expand description
The Info
trait provides database-agnostic methods for managing migrations
and interacting with migration states.
Required Methods§
sourcefn migrations(&self) -> &Vec<Box<dyn Migration<DB, State>>>
fn migrations(&self) -> &Vec<Box<dyn Migration<DB, State>>>
Returns a reference to the list of migrations.
sourcefn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB, State>>>
fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB, State>>>
Returns a mutable reference to the list of migrations.
Provided Methods§
sourcefn add_migrations(&mut self, migrations: Vec<Box<dyn Migration<DB, State>>>)
fn add_migrations(&mut self, migrations: Vec<Box<dyn Migration<DB, State>>>)
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.
sourcefn add_migration(&mut self, migration: Box<dyn Migration<DB, State>>)
fn add_migration(&mut self, migration: Box<dyn Migration<DB, State>>)
Adds a single migration to the migrator.