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 script.

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 is not automatically called during script initiation (as it would be during normal app startup) so is called manually here.

The script 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
script.

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`
is not automatically called during script initiation (as it would be
during normal app startup) so is called manually here.

The script 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

This is an alternative implementation to #2940 which avoids some of the issues of using migrations.

This approach yields the same result in the example given here.

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