pub struct MigrationManager<DB: Database> { /* private fields */ }Expand description
Main migration manager
Implementations§
Source§impl<DB: Database> MigrationManager<DB>
impl<DB: Database> MigrationManager<DB>
Sourcepub fn new(runner: Box<dyn MigrationRunner<DB> + Send + Sync>) -> Self
pub fn new(runner: Box<dyn MigrationRunner<DB> + Send + Sync>) -> Self
Create a new migration manager
Sourcepub fn register_migration(
&mut self,
migration: Migration,
postgres_sql: String,
mysql_sql: String,
)
pub fn register_migration( &mut self, migration: Migration, postgres_sql: String, mysql_sql: String, )
Register a migration with both PostgreSQL and MySQL SQL
Sourcepub async fn run_migrations(&self) -> Result<()>
pub async fn run_migrations(&self) -> Result<()>
Run all pending migrations
Auto Trait Implementations§
impl<DB> Freeze for MigrationManager<DB>
impl<DB> !RefUnwindSafe for MigrationManager<DB>
impl<DB> Send for MigrationManager<DB>
impl<DB> Sync for MigrationManager<DB>
impl<DB> Unpin for MigrationManager<DB>
impl<DB> UnsafeUnpin for MigrationManager<DB>
impl<DB> !UnwindSafe for MigrationManager<DB>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more