The issue is that the tables are created by the Flyway migrations. So, the cohort_inclusion_result
table is created as follows:
Note the missing mode_id
column. The same is true for the cohort_inclusion_stats
and cohort_summary_stats
tables.
The v2.5.0
release contains instructions on how to manually resolve the issue, but a Flyway migration was not included to automate this schema change. One possible solution is to provide a Flyway migration that brings the schema up to date, which is what I’ve done here.
For convenience, in Postgres, the solution is to run the following:
ALTER TABLE @resultsSchema.cohort_inclusion_result ADD mode_id int NOT NULL DEFAULT 0;
ALTER TABLE @resultsSchema.cohort_inclusion_stats ADD mode_id int NOT NULL DEFAULT 0;
ALTER TABLE @resultsSchema.cohort_summary_stats ADD mode_id int NOT NULL DEFAULT 0;
where @resultsSchema
is the name of the schema containing the WebAPI tables.