dm_add_fk()
marks the specified columns as the foreign key of table table
with
respect to the primary key of table ref_table
.
If check == TRUE
, then it will first check if the values in columns columns
are a subset
of the values of the primary key in table ref_table
.
dm_rm_fk()
can remove either one reference between two tables, or all references at once, if argument columns = NULL
.
All arguments may be provided quoted or unquoted.
dm_add_fk(dm, table, columns, ref_table, check = FALSE) dm_rm_fk(dm, table, columns, ref_table)
dm | A |
---|---|
table | A table in the |
columns | For For |
ref_table | For For |
check | Boolean, if |
For dm_add_fk()
: An updated dm
with an additional foreign key relation.
For dm_rm_fk()
: An updated dm
without the given foreign key relation.
Currently, keys consisting of more than one column are not supported. This feature is planned for dm 0.2.0. The syntax of these functions will be extended but will remain compatible with current semantics.
Other foreign key functions:
dm_enum_fk_candidates()
,
dm_get_all_fks()
,
dm_get_fk()
,
dm_has_fk()
Other foreign key functions:
dm_enum_fk_candidates()
,
dm_get_all_fks()
,
dm_get_fk()
,
dm_has_fk()