Struct migrate_state_file::FileStateLock [−][src]
pub struct FileStateLock { /* fields omitted */ }
Expand description
Implements StateLock
storing migration state in a file on the local
file system. It uses operating system advisory file locks
to support state locking.
Pass the file path in FileStateLock::new()
method. Default conventional
file name is migration-state
. Beware that the format of this file is private,
so you shouldn’t make any assumptions about it being json
, yaml
, toml
or anything else even UTF-8 encoded.
Example usage:
use migrate_state_file::FileStateLock; use migrate_core::Plan; let state_lock = FileStateLock::new("./migration-state"); let plan = Plan::builder(state_lock);
Implementations
Creates migration state file storage. Accepts the file path to migration state file.
If the file at the given path doesn’t exist, then state is considered uninitialized and a new file will be created once it is updated with new state info.
The default conventional name of the file is migration-state
See FileStateLock
struct docs for more details