Skip to content

Conversation

@Jongmassey
Copy link
Contributor

PR #2911 fixed the calculation of coding system release compatibility for codelist versions.

It did not correct the incorrectly calculated historical compatibility - this PR fixes #2913 .

This commit introduces a way of fixing that history via a Django migration.

In order to achieve this, the dynamically-set coding system database connections must be in place.
The function that does this- update_coding_system_database_connections checks to see if any migrations are pending and does not update the connections if so - meaning it is unusable in a migration. Therefore, this commit also adds an override mode to this function such that it can be used in a migration.

The migration then iterates through all releases of all coding systems (in release date order) and calls the
update_codelist_version_compatibility function that would normally be used in a coding system release import.

PR #2911 fixed the calculation of coding system release compatibility
for codelist versions.

It did not correct the incorrectly calculated historical compatibility.

This commit introduces a way of fixing that history via a Django
migration.

In order to achieve this, the dynamically-set coding system database
connections must be in place.
The function that does this- `update_coding_system_database_connections`
checks to see if any migrations are pending and does not update the
connections if so - meaning it is unusable in a migration.
Therefore, this commit also adds an override mode to this function such
that it can be used in a migration.

The migration then iterates through all releases of all coding systems
(in release date order) and calls the
`update_codelist_version_compatibility` function that would normally be
used in a coding system release import.
@Jongmassey
Copy link
Contributor Author

Comparing the codelist in which the parent issue was originally spotted:

live - no version compatibility

in local development server:

Other compatible releases
41.0.0 (2025-10-01);
41.2.0 (2025-11-26)

@Jongmassey Jongmassey changed the title Update release history compatibility Update release history compatibility using migration Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-bulild CodelistVersion's compatible_releases

2 participants