Validate table relations by recusively checking for the presence of key columns in other tables

validate_table_relation(tables_list, id_key = NULL, allowed_childless = NULL)

Arguments

tables_list

A list of data.tables

id_key

A named vector of key ID columns and their respective table names

allowed_childless

A character vector of tables that are allowed to have no child records. A common entry might be c('day', 'trip', 'linked_trip', 'tour') E.g., c('days', 'trips') we allow persons with no days and no trips.

Value

TRUE if all table relations are valid