[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
Mon Jul 10 11:31:36 CEST 2023


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

--- Comment #31 from Julian Maurice <julian.maurice at biblibre.com> ---
(In reply to Katrin Fischer from comment #30)
> (In reply to Julian Maurice from comment #29)
> > The timestamp must be set to the time of writing, and it must not be changed
> > at the time of push
> 
> Sorry, but I don't believe that makes sense. If the timestamp determines
> sequence, we can't do that. We have patches waiting years, they would "slip
> between" previous patches where they might not fit - arguments about
> sequence of database changes have been made before.

If I understand correctly you are saying that database schema modifications
must be applied in a strict order. But currently we have that only if we stay
on master. When jumping from stable versions to stable versions, the order is
not guaranteed.
Let's take an example:

If I'm on 22.05.10 and I jump to 22.11.06 and then to 23.05.01 the order of
migrations will be (bug numbers):
- [jump to 22.11.06]
- [not 32330] (already applied because backported on 22.05),
- 30642,
- ...
- [jump to 23.05.01]
- [not 32330] (already applied because backported on 22.05)
- 27424
- 20256
- [not 30642] (backported on 22.11)
- ...

To summarize: 30642 -> ... -> 27424 -> 20256 -> ...

But if I'm on 22.05.10 and I jump to 23.05.01, the order will be

27424 -> 20256 -> 30642 -> ...

30642 can be applied before or after 27424 depending on how often Koha is
updated.

Another example: bugs 33004 and 32799 are both in 22.11 and 23.05 but they were
pushed in a different order. If on 22.11 the order will be 33004 -> ... ->
32799, but if going directly to 23.05 it will be 32799 -> 33004

I understand that doing it the way I suggest "feels wrong". It's not intuitive.
But I encourage you to search and find an example that may cause problems with
this system (and that doesn't cause problems with the current one).
If someone can find one I'd be happy to close this bug.

> I also think there is a point about comparing versions - we cannot slow down
> Koha that needs to constantly check if the database needs updating. If this
> makes the check slower, because much more complex, that would be an issue.

It really is a minor slowdown. 1.5ms for 1000 migration files (which represents
two-thirds of the whole Koha history).
But I agree it's an unnecessary slowdown, and the check can moved to the start
of the application, as suggested in comment 17. Because it's always faster to
do nothing :)

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


More information about the Koha-bugs mailing list