Damien Regad
2014-09-05 22:34:21 UTC
I've been thinking at Paul's recent changes in some upgrade functions
(e.g. moving from serialized to json)
I have come to the conclusion that it's incorrect to alter existing
upgrade functions, as it potentially creates situations where we can no
longer know the state of the system and have incorrectly upgraded data.
For example, assume the following:
- upgrade function F() is called as part of version 2 (call it F()v2).
- F() is modified as part of version 3 (call that F()v3)
Admin A installs v1, then upgrades straight to v3; data gets modified by
F()v3.
Admin B installs v1, then upgrades to v2; data gets modified by F()v2.
Admin upgrades to v3, but data is still as of F()v2...
I believe the proper way to handle such situations where an upgrade
function needs to be changed, is to
1. create a NEW install function
2. add a NEW upgrade step
9dfc5fb6edb6da1e0324ceac3a27a727f2b23ba7 would have to be amended.
(e.g. moving from serialized to json)
I have come to the conclusion that it's incorrect to alter existing
upgrade functions, as it potentially creates situations where we can no
longer know the state of the system and have incorrectly upgraded data.
For example, assume the following:
- upgrade function F() is called as part of version 2 (call it F()v2).
- F() is modified as part of version 3 (call that F()v3)
Admin A installs v1, then upgrades straight to v3; data gets modified by
F()v3.
Admin B installs v1, then upgrades to v2; data gets modified by F()v2.
Admin upgrades to v3, but data is still as of F()v2...
I believe the proper way to handle such situations where an upgrade
function needs to be changed, is to
1. create a NEW install function
2. add a NEW upgrade step
9dfc5fb6edb6da1e0324ceac3a27a727f2b23ba7 would have to be amended.