Add a UNIQUE constraint.
(&mut self, name: &str, collection: &str, field: &str)
| 77 | |
| 78 | /// Add a UNIQUE constraint. |
| 79 | pub fn add_unique(&mut self, name: &str, collection: &str, field: &str) { |
| 80 | self.add(Constraint { |
| 81 | name: name.to_string(), |
| 82 | collection: collection.to_string(), |
| 83 | field: field.to_string(), |
| 84 | kind: ConstraintKind::Unique, |
| 85 | }); |
| 86 | } |
| 87 | |
| 88 | /// Add a FOREIGN KEY constraint. |
| 89 | pub fn add_foreign_key( |