Add missing upgrade script to account for db changes in version 2019080211 [ADS-61] #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://acclaim.atlassian.net/projects/ADS/board?issue-key=ADS-61
This PR adds a missing file
upgrade.php
which the moodle api docs specify needs to be added to allow for moodle to upgrade an existing plug in database from one version to another.The code here looks a bit out of nowhere but all of it is pretty much auto generated by moodle's XMLEditorTool which you can access by launching a local moodle server and installing this plug in.
This basically adds the missing db migrations that the previous version should have had and slaps on a new version so in order for the client who is experiencing this problem to fix they can just upgrade to a new version.
I worried a while about the scenario where
A - This version
B - Previous version (problem version missing upgrade.php)
C - Previous previous version
If a user happened to upgrade from C -> B -> A that it would duplicate the db changes but that actually is something we wouldnt have to worry about because in version B upgrade.php doesnt exist.