-
Bug
-
Resolution: Fixed
-
Minor
-
3.1, 3.2
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_31_STABLE
-
To avoid forgetting it in the clone for 3.2.0: Look to related MDL-56240
In order to have it properly detected for the future it would be great to add to all the upgrade.php scripts some lines like these:
// Moodle v3.1.0 release upgrade line.
|
// Put any upgrade step following this.
|
exactly before the "return true;" present in all the scripts.
I think it's ok to do that both in the 31_STABLE and master branches, so they will allow quickly find where 3.1.0 started and act once we decide future requirements.
The change can be performed globally with:
#!/bin/bash
|
export rel="3.1.0" && find . -name upgrade.php | \
|
xargs grep -l 'function.*xmldb_.*_upgrade' | \
|
grep '/db/' | \
|
xargs grep -L "Moodle v${rel} release upgrade" | \
|
xargs perl -p -i -e 's@( *)(return true;)@\1// Moodle v$ENV{rel} release upgrade line.\n\1// Put any upgrade step following this.\n\n\1\2@s'
|
Command to detect all the upgrade.php files not having those lines:
find . -name upgrade.php | xargs grep -l 'function.*xmldb_.*_upgrade' | grep '/db/' | xargs grep -L 'Moodle v3.1.0 release upgrade'
|
Commands to detect that we have not added the lines to incorrect files:
grep -lr 'Moodle v3.1.0 release upgrade' * | grep -v '/db/'
|
grep -lr 'Moodle v3.1.0 release upgrade' * | xargs grep -L 'function.*xmldb_.*_upgrade'
|
Command to detect if the lines have been added after a post-release upgrade step (visually verify occurrences):
export rel="3.1.0" && export ver="201605" &&
|
find . -name upgrade.php | \
|
xargs grep -B25 "Moodle v${rel} release upgrade" | \
|
grep "upgrade_.*_savepoint.*${ver}"
|
Ciao
- has a clone
-
MDL-57266 Add Moodle 3.2.0 upgrade line to all the upgrade.php scripts
- Closed
- has been marked as being related by
-
MDL-56240 Incorrect v3.2.0 release upgrade line's being introduced into the codebase
- Closed
- is a clone of
-
MDL-52140 Add Moodle 3.0.0 upgrade line to all the upgrade.php scripts
- Closed