Learn R Programming

dm (version 0.0.5.9000)

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 and reference 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, a check will be performed to determine 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()