pub struct SchemaMutation {
pub deleted: Vec<String>,
pub clp: Option<ClassLevelPermissions>,
pub set_fields: Vec<SetField>,
}Expand description
A PUT /schemas/:className reduced to the work the caller has to do.
#[must_use], and deleted is not an Option. Both are deliberate: a caller that applies
added and forgets deleted leaves a class carrying a field the client believes it removed,
and the field then reappears in every response.
Fields§
§deleted: Vec<String>Fields to drop, with their rows’ columns and, for a Relation, its join collection.
clp: Option<ClassLevelPermissions>None means the body carried no classLevelPermissions at all, which upstream treats as
“leave the stored block alone” (setPermissions returns early on undefined,
SchemaController.js:1097-1099). It is not the same as an empty block, which
replaces the stored one.
set_fields: Vec<SetField>Every submitted field that is not a delete, in body order, with the options it carried.
Includes fields that already exist, and includes empty option sets, because both are
meaningful. Upstream reaches enforceFieldExists for every submitted field, not only the
new ones (SchemaController.js:930-934), and resubmitting a field without the options it
was stored with is how a client clears them: updateFieldOptions writes whatever is left
after type and targetClass are removed, which for {"type":"String"} is {}
(MongoSchemaCollection.js:284-297).
Implementations§
Trait Implementations§
Source§impl Clone for SchemaMutation
impl Clone for SchemaMutation
Source§fn clone(&self) -> SchemaMutation
fn clone(&self) -> SchemaMutation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more