Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update row_count to bigint #63

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/AggregateCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion inst/settings/resultsDataModelSpecification.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Loading