pub struct Version { /* private fields */ }Expand description
The version represents the state of a schema at a point in time.
Implementations§
Source§impl Version
impl Version
Sourcepub fn pre_migration(&mut self, q: impl QueryBody + 'static)
pub fn pre_migration(&mut self, q: impl QueryBody + 'static)
Add a query to execute before before migrating to this schema (applied immediately before migration). Note that these may not run on new databases or if you later delete early migrations, so these should only modify existing data and not create new data (singleton rows, etc). If you need those, do it with a normal query executed manually against the latest version.
Sourcepub fn post_migration(&mut self, q: impl QueryBody + 'static)
pub fn post_migration(&mut self, q: impl QueryBody + 'static)
Add a query to execute after migrating to this schema version (applied
immediately after migration). See other warnings from pre_migration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Version
impl !RefUnwindSafe for Version
impl !Send for Version
impl !Sync for Version
impl Unpin for Version
impl !UnwindSafe for Version
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