Repository navigation
Create cohort_characterization_version on installs from the 3.0 baseline - #2570
Merged
Merged
Conversation
The B2.99.0006 baseline creates the version tables for cohorts, concept sets, incidence rates, pathways and reusables but not for characterizations, so on a fresh install every characterization update fails with SQLGrammarException while saving the previous version. Create the table if it is missing; databases upgraded from 2.x already have it.
chrisknoll
requested changes
Nov 2, 2026
chrisknoll
left a comment
Collaborator
There was a problem hiding this comment.
Sorry for duplication: we shouldn't make migration scripts conditional (via 'if not exists').
the baseline migration has the bug, we should fix this issue there.
Collaborator
|
Hi, I reflected on this more and it's a special case of an if-exists for a baseline migration problem. So I think i'll accept the if exist one but future tables should be created without 'if exists' this is only a special case. |
chrisknoll
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The B2.99.0006 baseline has no
cohort_characterization_versiontable. On a fresh 3.0 install, every characterization update therefore fails with HTTP 500SQLGrammarException(relation "webapi.cohort_characterization_version" does not exist) while saving the previous version, and the characterization version list fails the same way. This adds a migration that creates the table if it is missing. Databases upgraded from 2.x already have it, so there it is a no-op. The version is above 3.0.0 so installs baselined at 3.0.0 still pick it up.Reported in OHDSI/Atlas3#436.