reconcile_redcap_projects_history_schema
Source:R/redcap_projects_history.R
reconcile_redcap_projects_history_schema.RdDetects columns shared between a source and target table whose target type does not
match its desired type (see desired_column_type), and alters the target
table's type accordingly, preserving the target's existing nullability. Used to keep
redcap_projects_history in sync with upstream DDL revisions to REDCap's own
redcap_projects table (e.g. widened VARCHARs), and to migrate any
ENUM column to VARCHAR so that syncing data no longer fails with
truncation errors caused by new or pre-existing values outside the ENUM's
declared member list.
Usage
reconcile_redcap_projects_history_schema(
source_conn,
source_table,
target_conn,
target_table
)Value
a dataframe of the drifted columns that were altered, as returned by
get_column_type_drift
Examples
if (FALSE) { # \dontrun{
rc_conn <- redcapcustodian::connect_to_redcap_db()
rcc_billing_conn <- connect_to_rcc_billing_db()
drift <- reconcile_redcap_projects_history_schema(
source_conn = rc_conn,
source_table = "redcap_projects",
target_conn = rcc_billing_conn,
target_table = "redcap_projects_history"
)
} # }