diff --git a/UPGRADING.md b/UPGRADING.md index ffa889035d4..32869079567 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -6,6 +6,17 @@ More detailed information on key changes can be found in the [Developer update n The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com). +## 5.0.4+ + +### core_question + +#### Fixed + +- In order to prevent re-use of question version numbers after a version is deleted, the `nextversion` column was added to `question_bank_entries`. This serves as a counter incremented each time a version is created. + Do not query this field directly. Instead use `core_question\versions::get_next_version()` to read the value, which will initialise it based on the existing versions if it is not set yet. By default, it will increment the version number automatically, unless you pass `increment: false`. Because of this, it is advisable to call it inside a transaction, that is only committed after the version number is used in a `question_versions` record. + + For more information see [MDL-86798](https://tracker.moodle.org/browse/MDL-86798) + ## 5.0.4 ### core diff --git a/question/UPGRADING.md b/question/UPGRADING.md index 69058de83d5..8b5f7219cdc 100644 --- a/question/UPGRADING.md +++ b/question/UPGRADING.md @@ -1,5 +1,14 @@ # core_question (subsystem) Upgrade notes +## 5.0.4+ + +### Fixed + +- In order to prevent re-use of question version numbers after a version is deleted, the `nextversion` column was added to `question_bank_entries`. This serves as a counter incremented each time a version is created. + Do not query this field directly. Instead use `core_question\versions::get_next_version()` to read the value, which will initialise it based on the existing versions if it is not set yet. By default, it will increment the version number automatically, unless you pass `increment: false`. Because of this, it is advisable to call it inside a transaction, that is only committed after the version number is used in a `question_versions` record. + + For more information see [MDL-86798](https://tracker.moodle.org/browse/MDL-86798) + ## 5.0.2 ### Added