pub struct MigrationStatement<'a> { /* private fields */ }Expand description
A migration step pairing a DDL Statement with the [Schema] it applies against.
Each MigrationStatement carries a snapshot of the schema at the point where
the statement should be serialized. This is necessary because rename and
recreation operations modify the schema as they go.
Implementations§
Source§impl<'a> MigrationStatement<'a>
impl<'a> MigrationStatement<'a>
Sourcepub fn from_diff(
schema_diff: &'a SchemaDiff<'a>,
capability: &Capability,
) -> Vec<Self>
pub fn from_diff( schema_diff: &'a SchemaDiff<'a>, capability: &Capability, ) -> Vec<Self>
Generates migration statements from a [SchemaDiff].
Walks the diff’s type, table, column, and index changes and produces
the corresponding DDL statements. Type changes (CREATE TYPE, ALTER
TYPE) are emitted before table changes. On databases that lack
ALTER COLUMN support (e.g. SQLite), column type changes trigger a
full table recreation sequence.
Auto Trait Implementations§
impl<'a> Freeze for MigrationStatement<'a>
impl<'a> RefUnwindSafe for MigrationStatement<'a>
impl<'a> Send for MigrationStatement<'a>
impl<'a> Sync for MigrationStatement<'a>
impl<'a> Unpin for MigrationStatement<'a>
impl<'a> UnsafeUnpin for MigrationStatement<'a>
impl<'a> UnwindSafe for MigrationStatement<'a>
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