dm (version 0.0.3.9003)

cdm_add_fk: Add a reference from one table of a dm to another

Description

Add a reference from one table of a dm to another

Usage

cdm_add_fk(dm, table, column, ref_table, check = FALSE)

Arguments

dm

A dm object.

table

A table in the dm

column

The column of table which is to become the foreign key column referencing the primary key of ref_table.

ref_table

The table which table is referencing. This table needs to have a primary key set.

check

Boolean, if TRUE (default), a check is performed, if the values of column are a subset of the values of the primary key column of ref_table.

See Also

Other foreign key functions: cdm_enum_fk_candidates, cdm_get_all_fks, cdm_get_fk, cdm_has_fk, cdm_rm_fk