pub struct Migrator<'a, D> { /* private fields */ }Expand description
auth.migrator().
Implementations§
Source§impl<'a, D: Adapter> Migrator<'a, D>
impl<'a, D: Adapter> Migrator<'a, D>
Sourcepub fn mode(&self) -> Migrations
pub fn mode(&self) -> Migrations
Whether this migrator may change the database.
pub async fn plan(&self) -> DbResult<MigrationPlan>
Sourcepub async fn apply(&self, plan: &MigrationPlan) -> DbResult<()>
pub async fn apply(&self, plan: &MigrationPlan) -> DbResult<()>
Applies plan. Refused with ReviewOnly under Migrations::ReviewOnly.
Sourcepub async fn run(&self) -> DbResult<MigrationPlan>
pub async fn run(&self) -> DbResult<MigrationPlan>
Plans and applies. Safe to call on every startup.
Sourcepub async fn sql_steps(&self) -> DbResult<Vec<MigrationSql>>
pub async fn sql_steps(&self) -> DbResult<Vec<MigrationSql>>
The plan as separate migrations, one per change, for review: a new table comes with
its indexes and unique constraints, and every other step stands alone. A unique
constraint on an existing table starts with a comment holding the query that lists
the rows it would refuse, when the adapter can render one
(Adapter::duplicates_query); run it first, it must return no rows.
Auto Trait Implementations§
impl<'a, D> Forget for Migrator<'a, D>
impl<'a, D> Freeze for Migrator<'a, D>
impl<'a, D> Move for Migrator<'a, D>
impl<'a, D> RefUnwindSafe for Migrator<'a, D>where
&'a D: RefUnwindSafe,
impl<'a, D> Send for Migrator<'a, D>
impl<'a, D> Sync for Migrator<'a, D>
impl<'a, D> Unpin for Migrator<'a, D>
impl<'a, D> UnsafeUnpin for Migrator<'a, D>where
&'a D: UnsafeUnpin,
impl<'a, D> UnwindSafe for Migrator<'a, D>where
&'a D: UnwindSafe,
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