[Koha-bugs] [Bug 7167] updatedatabase improvements
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Jan 6 14:36:26 CET 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7167
--- Comment #37 from Ian Walls <ian.walls at bywatersolutions.com> 2012-01-06 13:36:26 UTC ---
Counter proposal:
Just like we initially thought
* patches would be submitted in a specific file, in atomicupdate directory
* a new file (YAML) would be added, that would have 2 columns, one for
the version number, one for the atomicupdate file name
* updatedatabase wouldn't change anymore: we would just add something like :
LoadYAMLFile()
ForEachLine {
if (C4::Context->preference("Version") < FirstColumnYAML) {
exec(secondColumnYAML);
SetVersion (FirstColumnYAML);
}
}
The YAML file would be updated only by the Release Manager, when he
pushes a patch.
But additionally,
* Each atomic update would be named descriptively, not numerically.
Preferrably referencing the bug number
* The updates would all have the following 4 functions:
CHECK: determines if the change is needed
DESCRIBE: display the text for what this change is supposed to do
DO: execute the change
UNDO: revert the change
* CHECK would always be run first. If the change is warranted, DESCRIBE would
be run. After a confirmation from the user, DO is run.
* Similar process could be implemented to downgrade Koha, using UNDO instead of
DO.
This solves linearity, in that any update can DOne in any order.
It also makes reverting patches easier; if a patch you're testing contains a DB
update, you can run the UNDO before switching back to master. This prevents
cumulative database corruption from testing DB-rev patches
Duplicate Key entries and other problems that could come from running an update
twice are avoided.
Update descriptions can be viewed in advance, so you know what you're going to
get.
--
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the Koha-bugs
mailing list