]> git.koha-community.org Git - koha.git/commit
Bug 34088: Short circuit database upgrade check
authorDavid Cook <dcook@prosentient.com.au>
Thu, 22 Jun 2023 00:56:12 +0000 (00:56 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Thu, 29 Aug 2024 16:16:19 +0000 (18:16 +0200)
commit8abaff77845d9d2198c2181931a27bb0b9a5fb9c
tree23377f59a07506ae53578805767c0d9abe8794cd
parent317456da49d68ee95a56adcc2316a2f62e1edf6a
Bug 34088: Short circuit database upgrade check

If the database version and the code version are the same, we should
short circuit and exit immediately.

This patch adds the Koha::Installer module which can very quickly
check if a db or atomic update is needed.

It also moves the logic for C4::Installer::TransformToNum to
Koha::Installer::TransformToNum for performance reasons.

It also moves the logic for C4::Installer::get_atomic_updates to
Koha::Installer::get_atomic_updates for performance reasons.

Test plan:
1. Apply patch
2. Run `time koha-upgrade-schema kohadev`
3. Note that it completes in less than .1 seconds

4. To test db updates, change the database Version to a number
slightly behind the code version, and run
`time koha-upgrade-schema kohadev`
5. Note that the correct version update is processed

6. To test atomic updates:
cp installer/data/mysql/atomicupdate/skeleton.pl \
       installer/data/mysql/atomicupdate/bug_34088.pl
7. Run `time koha-upgrade-schema kohadev`
8. Note that it takes over 1 second to run and the atomic update
is attempted

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
C4/Installer.pm
Koha/Installer.pm [new file with mode: 0644]
installer/data/mysql/updatedatabase.pl