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.
Arguments
- dm
A
dmobject.- table
A table in the
dm. PassNULLto remove all matching keys.- columns
Table columns, unquoted. To refer to a compound key, use
c(col1, col2). PassNULL(the default) to remove all matching keys.- ref_table
The table referenced by the
tableargument. PassNULLto remove all matching keys.- ref_columns
The columns of
tablethat should no longer be referencing the primary key ofref_table. To refer to a compound key, usec(col1, col2).- ...
These dots are for future extensions and must be empty.
See also
Other foreign key functions:
dm_add_fk(),
dm_enum_fk_candidates(),
dm_get_all_fks()
Examples
dm_nycflights13(cycle = TRUE) %>%
dm_rm_fk(flights, dest, airports) %>%
dm_draw()
