diff --git a/R/learn.R b/R/learn.R index 79cdf87b44..4f4744e862 100644 --- a/R/learn.R +++ b/R/learn.R @@ -107,7 +107,10 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% dm_update_zoomed() %>% dm_zoom_to(constraint_column_usage) %>% - left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% + + # inner_join(): Matching column sometimes not found on Postgres + inner_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>% + dm_update_zoomed() %>% dm_select_tbl(-columns) %>% dm_rename(constraint_column_usage, constraint_column_usage.table_catalog = table_catalog) %>% @@ -153,10 +156,6 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma ))) %>% ungroup() %>% select(-(1:3)) %>% - - # FIXME: Where does this come from? - filter(!is.na(ref_table)) %>% - group_by(table = ref_table) %>% summarize(fks = list(bind_rows(fks))) %>% ungroup()