pub struct SchemaDiff {
pub added_tables: Vec<String>,
pub dropped_tables: Vec<String>,
pub added_columns: Vec<(String, String)>,
pub dropped_columns: Vec<(String, String)>,
pub type_changes: Vec<(String, String, String, String)>,
pub nullability_changes: Vec<(String, String, bool)>,
}Expand description
Description of the changes a deploy is about to apply, passed as the
payload to the on_migrate hook so user code can decide which backfill
blocks should fire.
Fields§
§added_tables: Vec<String>§dropped_tables: Vec<String>§added_columns: Vec<(String, String)>(table, column) pairs for newly added columns. In phase 2 these already exist in the database (added in phase 1) but may be NULL on existing rows; the hook is the place to backfill them.
dropped_columns: Vec<(String, String)>(table, column) pairs for columns that will be dropped in phase 3. During phase 2 these are still present in the database, so the hook can read them to populate new columns before they disappear.
type_changes: Vec<(String, String, String, String)>(table, column, old_type, new_type)
nullability_changes: Vec<(String, String, bool)>(table, column, new_nullable)
Implementations§
Source§impl SchemaDiff
impl SchemaDiff
Trait Implementations§
Source§impl Clone for SchemaDiff
impl Clone for SchemaDiff
Source§fn clone(&self) -> SchemaDiff
fn clone(&self) -> SchemaDiff
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaDiff
impl Debug for SchemaDiff
Source§impl Default for SchemaDiff
impl Default for SchemaDiff
Source§fn default() -> SchemaDiff
fn default() -> SchemaDiff
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SchemaDiff
impl<'de> Deserialize<'de> for SchemaDiff
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 SchemaDiff
impl RefUnwindSafe for SchemaDiff
impl Send for SchemaDiff
impl Sync for SchemaDiff
impl Unpin for SchemaDiff
impl UnsafeUnpin for SchemaDiff
impl UnwindSafe for SchemaDiff
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