pub struct LockFile {
pub version: u32,
pub migrations: Vec<LockEntry>,
}Expand description
Migration lock file for tamper detection.
Stores checksums of all migrations to detect if they’ve been modified after being applied. This prevents data integrity issues from migrations being changed retroactively.
Fields§
§version: u32Version of lock file format
migrations: Vec<LockEntry>Locked migrations (stored as vec for TOML compatibility)
Implementations§
Source§impl LockFile
impl LockFile
Sourcepub fn lock(&mut self, file: &MigrationFile)
pub fn lock(&mut self, file: &MigrationFile)
Adds a migration to the lock file.
Sourcepub fn validate(&self, files: &[MigrationFile]) -> Result<()>
pub fn validate(&self, files: &[MigrationFile]) -> Result<()>
Validates migrations against lock file.
Sourcepub fn update(&mut self, files: &[MigrationFile]) -> Result<()>
pub fn update(&mut self, files: &[MigrationFile]) -> Result<()>
Updates lock file with new migrations.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LockFile
impl<'de> Deserialize<'de> for LockFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LockFile
impl RefUnwindSafe for LockFile
impl Send for LockFile
impl Sync for LockFile
impl Unpin for LockFile
impl UnsafeUnpin for LockFile
impl UnwindSafe for LockFile
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