diff --git a/R/AggregateCovariates.R b/R/AggregateCovariates.R index 8a3c220..6292b1d 100644 --- a/R/AggregateCovariates.R +++ b/R/AggregateCovariates.R @@ -260,7 +260,7 @@ computeTargetAggregateCovariateAnalyses <- function( message("Extracting target cohort counts") sql <- "select cohort_definition_id, - count(*) row_count, + count_big(*) row_count, count(distinct subject_id) person_count, min(datediff(day, cohort_start_date, cohort_end_date)) min_exposure_time, avg(datediff(day, cohort_start_date, cohort_end_date)) mean_exposure_time, diff --git a/inst/settings/resultsDataModelSpecification.csv b/inst/settings/resultsDataModelSpecification.csv index 3dc0e59..ecd5d9e 100644 --- a/inst/settings/resultsDataModelSpecification.csv +++ b/inst/settings/resultsDataModelSpecification.csv @@ -113,7 +113,7 @@ cohort_counts,start_anchor,varchar(15),No,No,No,No,The start anchor cohort_counts,end_anchor,varchar(15),No,No,No,No,The end anchor cohort_counts,min_prior_observation,int,No,No,No,No,Minimum time observed before index cohort_counts,outcome_washout_days,int,No,No,No,No,Patients with outcome during washout are excluded -cohort_counts,row_count,int,Yes,No,No,No,The number of rows in each cohort +cohort_counts,row_count,bigint,Yes,No,No,No,The number of rows in each cohort cohort_counts,person_count,int,Yes,No,No,No,The number of distinct people in each cohort cohort_counts,min_exposure_time,bigint,No,No,No,No,Minimum exposure time across cohort cohort_counts,mean_exposure_time,bigint,No,No,No,No,Mean exposure time across cohort diff --git a/inst/sql/sql_server/migrations/Migration_2-v2_0_2_row_count_bigint.sql b/inst/sql/sql_server/migrations/Migration_2-v2_0_2_row_count_bigint.sql new file mode 100644 index 0000000..5d6f626 --- /dev/null +++ b/inst/sql/sql_server/migrations/Migration_2-v2_0_2_row_count_bigint.sql @@ -0,0 +1,5 @@ +-- Database migrations for verion 2.0.2 +-- This migration updates the schema: + -- 1. To expand the row_count column to a bigint + +ALTER TABLE @database_schema.@table_prefixcohort_counts ALTER COLUMN row_count BIGINT;