Skip to main content

SchemaChange

Enum SchemaChange 

Source
pub enum SchemaChange {
Show 15 variants CreateEntity(Entity), RetireFieldConstraint { entity: String, field: String, constraint: FieldConstraint, }, ConvertField { entity: String, previous: Field, field: Field, }, WidenIntegerToDecimal { entity: String, field: String, }, CopyJsonRecords { source_entity: String, source_field: String, source_filter: Predicate, section: String, target_entity: String, fields: Vec<String>, }, PromoteIdentity { entity: String, field: String, }, AddField { entity: String, field: Field, }, AddUnique { entity: String, fields: Vec<String>, }, AddIndex { entity: String, fields: Vec<String>, }, AddConditionalIndex { entity: String, index: Index, }, Seed { entity: String, values: Map<String, Value>, }, SeedFrom { entity: String, absent_filter: Predicate, source_entity: String, source_filter: Predicate, fields: BTreeMap<String, String>, values: Map<String, Value>, }, Backfill { entity: String, filter: Predicate, values: Map<String, Value>, }, CopyField { entity: String, source: String, target: String, filter: Predicate, }, DeleteWhere { entity: String, filter: Predicate, },
}
Expand description

Additive schema changes with a backend-independent migration identity.

Variants§

§

CreateEntity(Entity)

§

RetireFieldConstraint

Retires exactly one obsolete physical constraint absent from the logical field. Other historical constraints, records, identities and indexes remain intact.

Fields

§entity: String
§field: String
§constraint: FieldConstraint
§

ConvertField

Converts stored values and the physical field using one shared lossless preflight.

Fields

§entity: String
§previous: Field
§field: Field
§

WidenIntegerToDecimal

Widens an existing integer value to an exact two-place decimal without changing its name, identity, or historical value.

Fields

§entity: String
§field: String
§

CopyJsonRecords

Adopts declared records from a historical JSON array into typed storage. Source filtering and the explicit field list prevent importing unrelated app data or accepting unrecognized columns.

Fields

§source_entity: String
§source_field: String
§source_filter: Predicate
§section: String
§target_entity: String
§fields: Vec<String>
§

PromoteIdentity

Convert an existing single-column integer primary key into a generated key.

Fields

§entity: String
§field: String
§

AddField

Fields

§entity: String
§field: Field
§

AddUnique

Fields

§entity: String
§fields: Vec<String>
§

AddIndex

Fields

§entity: String
§fields: Vec<String>
§

AddConditionalIndex

Fields

§entity: String
§index: Index
§

Seed

Fields

§entity: String
§values: Map<String, Value>
§

SeedFrom

Creates a missing logical record from exactly one qualifying source row. Existing target records are preserved; absent or ambiguous sources fail closed.

Fields

§entity: String
§absent_filter: Predicate
§source_entity: String
§source_filter: Predicate
§values: Map<String, Value>
§

Backfill

Fields

§entity: String
§filter: Predicate
§values: Map<String, Value>
§

CopyField

Fields

§entity: String
§source: String
§target: String
§filter: Predicate
§

DeleteWhere

Fields

§entity: String
§filter: Predicate

Trait Implementations§

Source§

impl Clone for SchemaChange

Source§

fn clone(&self) -> SchemaChange

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaChange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SchemaChange

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SchemaChange

Source§

fn eq(&self, other: &SchemaChange) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SchemaChange

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SchemaChange

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,