Add a NOT NULL constraint.
(&mut self, name: &str, collection: &str, field: &str)
| 127 | |
| 128 | /// Add a NOT NULL constraint. |
| 129 | pub fn add_not_null(&mut self, name: &str, collection: &str, field: &str) { |
| 130 | self.add(Constraint { |
| 131 | name: name.to_string(), |
| 132 | collection: collection.to_string(), |
| 133 | field: field.to_string(), |
| 134 | kind: ConstraintKind::NotNull, |
| 135 | }); |
| 136 | } |
| 137 | |
| 138 | /// Get all constraints for a given collection. |
| 139 | pub fn for_collection(&self, collection: &str) -> Vec<&Constraint> { |