pub struct MigrationManager { /* private fields */ }Expand description
Migration manager
Implementations§
Source§impl MigrationManager
impl MigrationManager
pub fn new(migrations_dir: impl AsRef<Path>) -> Self
pub fn list_migrations(&self) -> Result<Vec<Migration>, Error>
pub fn create_migration(&self, name: &str) -> Result<PathBuf, Error>
Sourcepub async fn ensure_migrations_table(&self, db: &impl Database) -> Result<()>
pub async fn ensure_migrations_table(&self, db: &impl Database) -> Result<()>
Ensure migrations table exists
Sourcepub async fn get_applied_migrations(
&self,
db: &impl Database,
) -> Result<Vec<String>>
pub async fn get_applied_migrations( &self, db: &impl Database, ) -> Result<Vec<String>>
Get list of applied migrations
Sourcepub async fn mark_migration_applied(
&self,
db: &impl Database,
version: &str,
) -> Result<()>
pub async fn mark_migration_applied( &self, db: &impl Database, version: &str, ) -> Result<()>
Mark migration as applied
Auto Trait Implementations§
impl Freeze for MigrationManager
impl RefUnwindSafe for MigrationManager
impl Send for MigrationManager
impl Sync for MigrationManager
impl Unpin for MigrationManager
impl UnwindSafe for MigrationManager
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