pub struct Migration {
pub version: i64,
pub name: &'static str,
pub apply: fn(&Transaction<'_>) -> Result<(), Error>,
}Expand description
One schema migration step for a domain.
Fields§
§version: i64Target version this migration brings the domain to. Versions are contiguous and start at 1.
name: &'static strStable human-readable name (shows up in errors and reports).
apply: fn(&Transaction<'_>) -> Result<(), Error>The migration body. Runs inside the runner’s IMMEDIATE transaction; it must not end that transaction (nested savepoints of its own are fine). Bodies lifted from historical upgrade functions keep their internal idempotence guards.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Migration
impl RefUnwindSafe for Migration
impl Send for Migration
impl Sync for Migration
impl Unpin for Migration
impl UnsafeUnpin for Migration
impl UnwindSafe for Migration
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