pub struct MigrationStore { /* private fields */ }Expand description
Reads and writes migration scripts on disk.
Layout:
Migrations/
20260625_InitialCreate/
up.sql
down.sqlImplementations§
Source§impl MigrationStore
impl MigrationStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn root(&self) -> &Path
Sourcepub fn save(&self, migration: &Migration) -> EFResult<()>
pub fn save(&self, migration: &Migration) -> EFResult<()>
Saves a migration as {id}/up.sql and {id}/down.sql.
Sourcepub fn load_all(&self) -> EFResult<Vec<Migration>>
pub fn load_all(&self) -> EFResult<Vec<Migration>>
Loads all migrations sorted by id (timestamp prefix recommended).
pub fn load(&self, id: &str) -> EFResult<Migration>
Sourcepub fn save_snapshot(&self, snapshot: &ModelSnapshot) -> EFResult<()>
pub fn save_snapshot(&self, snapshot: &ModelSnapshot) -> EFResult<()>
Writes a model snapshot JSON file for the next diff baseline.
pub fn load_snapshot(&self) -> EFResult<Option<ModelSnapshot>>
Trait Implementations§
Source§impl Clone for MigrationStore
impl Clone for MigrationStore
Auto Trait Implementations§
impl Forget for MigrationStore
impl Freeze for MigrationStore
impl RefUnwindSafe for MigrationStore
impl Send for MigrationStore
impl Sync for MigrationStore
impl Unpin for MigrationStore
impl UnsafeUnpin for MigrationStore
impl UnwindSafe for MigrationStore
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