diff --git a/R/Export.R b/R/Export.R index 97ae2ad..5c542be 100644 --- a/R/Export.R +++ b/R/Export.R @@ -256,6 +256,7 @@ exportExposuresOutcomes <- function(outputFolder, exportFolder) { exposuresOutcomeSet <- tibble( exposuresOutcomeSetId = i, + nestingCohortId = eso$nestingCohortId, outcomeId = eso$outcomeId ) sccsExposuresOutcomeSet[[length(sccsExposuresOutcomeSet) + 1]] <- exposuresOutcomeSet diff --git a/inst/csv/resultsDataModelSpecification.csv b/inst/csv/resultsDataModelSpecification.csv index 2b80332..146e9cc 100644 --- a/inst/csv/resultsDataModelSpecification.csv +++ b/inst/csv/resultsDataModelSpecification.csv @@ -21,6 +21,7 @@ sccs_era,era_name,varchar,No,No,No,A name for the era. Is NULL for eras derived sccs_era,database_id,varchar,Yes,Yes,No,Foreign key referencing the database. sccs_exposures_outcome_set,exposures_outcome_set_id,int,Yes,Yes,No,A unique identifier for a set of exposures and an outcome. sccs_exposures_outcome_set,outcome_id,int,Yes,No,No,A cohort ID. +sccs_exposures_outcome_set,nesting_cohort_id,int,No,No,No,A cohort ID. sccs_exposure,exposures_outcome_set_id,int,Yes,Yes,No,A foreign key referencing the sccs_exposures_outcome_set table. sccs_exposure,era_id,int,Yes,Yes,No,A foreign key referencing the sccs_era table. sccs_exposure,true_effect_size,float,No,No,No,"If known, the true effect size. For negatitive controls this equals 1." diff --git a/inst/sql/sql_server/migrations/Migration_2-v5_1_0.sql b/inst/sql/sql_server/migrations/Migration_2-v5_1_0.sql new file mode 100644 index 0000000..f9cfe06 --- /dev/null +++ b/inst/sql/sql_server/migrations/Migration_2-v5_1_0.sql @@ -0,0 +1,5 @@ +-- Database migrations for version 5.1.0 +-- This migration updates the schema: + -- 1. Adds the nesting_cohort_id to the sccs_exposures_outcome_set table + +ALTER TABLE @database_schema.@table_prefixsccs_exposures_outcome_set ADD nesting_cohort_id FLOAT