fail the schema-update if there are existing Evidence or EvidenceVariable resource instances #3681
Description
Is your feature request related to a problem? Please describe.
Evidence and EvidenceVariable are the two resource types in R4B where a valid R4 instance is basically guaranteed not to parse.
That means that, after migration to our 5.0.0, certain interactions could blow up on any existing resources of this type in the db.
Describe the solution you'd like
To avoid a big surprise down-the-line, I think it would be better just to fail the schema-upgrade in cases where there is data in the Evidence_RESOURCES or EvidenceVariable_RESOURCES tables.
Describe alternatives you've considered
Provide steps to patch the old Evidence and EvidenceVariable resources instead
Acceptance Criteria
-
GIVEN a 4.11.1 schema with Evidence or EvidenceVariable resources
WHEN 5.0.0-SNAPSHOT schema upgrade is applied
THEN the upgrade is aborted
AND there is a useful error message near the bottom of the output
AND no other schema changes were applied -
GIVEN a 4.11.1 schema with no Evidence or EvidenceVariable resources
WHEN 5.0.0-SNAPSHOT schema upgrade is applied
THEN the schema upgrade is successful
Additional context
EvidenceVariable too?