(tbl_fk: &TableForeignKey)
| 218 | |
| 219 | impl From<&TableForeignKey> for Relation { |
| 220 | fn from(tbl_fk: &TableForeignKey) -> Self { |
| 221 | let ref_table = match tbl_fk.get_ref_table() { |
| 222 | Some(s) => unpack_table_ref(s), |
| 223 | None => panic!("RefTable should not be empty"), |
| 224 | }; |
| 225 | let columns = tbl_fk.get_columns(); |
| 226 | let ref_columns = tbl_fk.get_ref_columns(); |
| 227 | let rel_type = RelationType::BelongsTo; |
| 228 | let on_delete = tbl_fk.get_on_delete(); |
| 229 | let on_update = tbl_fk.get_on_update(); |
| 230 | Self { |
| 231 | ref_table, |
| 232 | columns, |
| 233 | ref_columns, |
| 234 | rel_type, |
| 235 | on_delete, |
| 236 | on_update, |
| 237 | self_referencing: false, |
| 238 | num_suffix: 0, |
| 239 | impl_related: true, |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | #[cfg(test)] |
nothing calls this directly
no test coverage detected