[Koha-bugs] [Bug 34088] Schema upgrade should short circuit faster if no upgrade needs to be done

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 4 03:53:03 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34088

David Cook <dcook at prosentient.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #152995|0                           |1
        is obsolete|                            |

--- Comment #9 from David Cook <dcook at prosentient.com.au> ---
Created attachment 152996
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152996&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list