You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letmut subtable:Option<Table> = match col["cols"].is_badvalue(){
263
263
true => None,
264
264
false => {
265
-
if norm.is_some() && col["file"].is_badvalue(){// Normalized subtable; writes its primary key into the parent table
265
+
if norm.is_some() && col["file"].is_badvalue(){// Many-to-one relation (subtable with fkey in parent table)
266
266
letmut subtable = add_table(colname,&path, norm, settings, col["cols"].as_vec().unwrap_or_else(|| fatalerr!("Error: subtable 'cols' entry is not an array")),None);
267
267
subtable.normalized = true;
268
268
Some(subtable)
269
269
}
270
-
else{
270
+
else{// If norm.is_some(): many-to-many relation (this file will contain the crosslink table)
271
+
// Otherwise: one-to-many relation (this file will contain the subtable with the parent table fkey)
271
272
let filename = col["file"].as_str().unwrap_or_else(|| fatalerr!("Error: subtable {} has no 'file' entry", colname));
272
273
if table.columns.is_empty(){fatalerr!("Error: table '{}' cannot have a subtable as first column", name);}
273
274
Some(add_table(colname,&path,Some(filename), settings, col["cols"].as_vec().unwrap_or_else(|| fatalerr!("Error: subtable 'cols' entry is not an array")),Some(format!("{} {}", name, table.columns[0].datatype))))
0 commit comments