[Koha-bugs] [Bug 27880] Store each database migrations state in database

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jul 5 09:07:15 CEST 2023


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

--- Comment #28 from Julian Maurice <julian.maurice at biblibre.com> ---
(In reply to David Cook from comment #25)
> I'm a bit surprised that pending_migrations ran that fast. It takes me a lot
> longer just to load C4::Context and get a database handle via
> C4::Context->dbh on koha-testing-docker. Did you run that on
> koha-testing-docker or on a server?

I opened the database connection before starting the timer. I wanted to measure
only the database query + listing the files.
Here's the code: https://pastes.io/mf644kcqog

> What do you think about bug 34088 in this context? If the code version and
> the database version match and there are no atomic updates to run, it exits
> out of updatedatabase.pl. Koha::Migrations does look pretty minimal, but I
> found C4::Context to be too slow, so I used Koha::Database::dbh() and
> Koha::Config for a database handle and config since they were much faster to
> load and use.

C4::Context is useless in Koha::Migrations and can be replaced by
Koha::Database. But it will still be slower than comparing two version numbers

(In reply to David Cook from comment #27)
> (In reply to David Cook from comment #26)
> > (But to be fair, I think that this might actually be a problem with the
> > current db_revs system as well... I'd have to test it...)
> 
> Actually, it might not be a problem with the current version, because
> db_revs also check their version against the database version.

With db_revs, in your scenario the order of update would be (23.05) Bug 1 ->
Bug 3 -> (switch to 23.11) Bug 2 -> Bug 3
So I think we have the same problem. The only difference is that Bug 3 is
executed twice.

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


More information about the Koha-bugs mailing list