[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 06:55:12 CEST 2023


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

--- Comment #26 from David Cook <dcook at prosentient.com.au> ---
(In reply to Julian Maurice from comment #18)
> Sequence does matter indeed. But there are several different valid sequences
> of execution.
> You can't write a migration to add a FK to a table before the migration to
> add the table has been written, so the timestamp for the FK migration will
> always be after the timestamp for the table migration. So these two
> migrations will always be executed in the correct order.
> But if you have a migration that adds a column to table A and another
> migration that adds a column to table B, the order of execution of these two
> migrations does not matter.

I understand your logic here, but I just wonder if you're missing some
scenarios.

I'm struggling to think of them, but there's just something bothering me in the
back of my mind.

At the moment, I wonder about backporting causing problems...

Scenario:
Version 23.05 and Master
- Bug 1 : Add column A to Table A

Master:
- Bug 2 : Modify Column A in Table A
- Bug 3 : Drop Column A in Table A

23.05:
- Bug 3 : Drop Column A in Table A (backported)

--

When you upgrade from 23.05 to 23.11, the migration for Bug 2 will exist on the
file system, but it won't be marked as executed in the database, so Koha will
try to apply the migration for Bug 2, and it should generate an error.

(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...)

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


More information about the Koha-bugs mailing list