pub struct MigrationManager { /* private fields */ }Expand description
Migration manager
Implementations§
Source§impl MigrationManager
impl MigrationManager
pub fn new(pool: PgPool) -> Self
Sourcepub async fn rollback_n(&self, count: usize) -> Result<()>
pub async fn rollback_n(&self, count: usize) -> Result<()>
Rollback a specific number of migrations
Sourcepub async fn history(&self) -> Result<Vec<MigrationRecord>>
pub async fn history(&self) -> Result<Vec<MigrationRecord>>
Get migration history
Sourcepub async fn status(&self) -> Result<MigrationStatus>
pub async fn status(&self) -> Result<MigrationStatus>
Validate migration status
Sourcepub async fn create_migration(&self, name: &str) -> Result<()>
pub async fn create_migration(&self, name: &str) -> Result<()>
Create a new paired up/down migration: <ts>_<name>.up.sql and
<ts>_<name>.down.sql under migrations/. Timestamp is the
YYYYMMDDHHMMSS form so it sorts cleanly next to generator-emitted
migrations.
Auto Trait Implementations§
impl !RefUnwindSafe for MigrationManager
impl !UnwindSafe for MigrationManager
impl Freeze for MigrationManager
impl Send for MigrationManager
impl Sync for MigrationManager
impl Unpin for MigrationManager
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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