pub struct Migration {
pub id: String,
pub dependencies: Vec<String>,
pub operations: Vec<Operation>,
pub atomic: bool,
}Expand description
A single migration: an ordered, dependency-aware set of operations.
id is derived from the filename at load time and is not stored in the file.
Fields§
§id: String§dependencies: Vec<String>§operations: Vec<Operation>§atomic: boolWhen false, this migration runs outside a transaction. Required for operations that cannot run inside a transaction (e.g. CREATE INDEX CONCURRENTLY). Defaults to true so existing migration files are unaffected.
Implementations§
Source§impl Migration
impl Migration
pub fn from_yaml_str(s: &str) -> Result<Self, Error>
pub fn to_yaml_string(&self) -> Result<String, Error>
Sourcepub fn get_entities(&self) -> HashSet<(EntityKind, String)>
pub fn get_entities(&self) -> HashSet<(EntityKind, String)>
Returns the set of top-level entities touched by this migration. Includes FK target tables so callers can detect cross-namespace references.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Migration
impl<'de> Deserialize<'de> for Migration
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 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