powered by
dm_rm_fk() can remove either one reference between two tables, or multiple references at once (with a message). An error is thrown if no matching foreign key is found.
dm_rm_fk()
dm_rm_fk( dm, table = NULL, columns = NULL, ref_table = NULL, ref_columns = NULL, ... )
A dm object.
dm
A table in the dm. Pass NULL to remove all matching keys.
NULL
Table columns, unquoted. To refer to a compound key, use c(col1, col2). Pass NULL (the default) to remove all matching keys.
c(col1, col2)
The table referenced by the table argument. Pass NULL to remove all matching keys.
table
The columns of table that should no longer be referencing the primary key of ref_table. To refer to a compound key, use c(col1, col2).
ref_table
These dots are for future extensions and must be empty.
An updated dm without the matching foreign key relation(s).
Other foreign key functions: dm_add_fk(), dm_enum_fk_candidates(), dm_get_all_fks()
dm_add_fk()
dm_enum_fk_candidates()
dm_get_all_fks()
# NOT RUN { dm_nycflights13(cycle = TRUE) %>% dm_rm_fk(flights, dest, airports) %>% dm_draw() # }
Run the code above in your browser using DataLab