Add a FOREIGN KEY constraint.
(
&mut self,
name: &str,
collection: &str,
field: &str,
ref_collection: &str,
ref_key: &str,
)
| 87 | |
| 88 | /// Add a FOREIGN KEY constraint. |
| 89 | pub fn add_foreign_key( |
| 90 | &mut self, |
| 91 | name: &str, |
| 92 | collection: &str, |
| 93 | field: &str, |
| 94 | ref_collection: &str, |
| 95 | ref_key: &str, |
| 96 | ) { |
| 97 | self.add(Constraint { |
| 98 | name: name.to_string(), |
| 99 | collection: collection.to_string(), |
| 100 | field: field.to_string(), |
| 101 | kind: ConstraintKind::ForeignKey { |
| 102 | ref_collection: ref_collection.to_string(), |
| 103 | ref_key: ref_key.to_string(), |
| 104 | }, |
| 105 | }); |
| 106 | } |
| 107 | |
| 108 | /// Add a BITEMPORAL FOREIGN KEY constraint. |
| 109 | pub fn add_bitemporal_fk( |