[Koha-bugs] [Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 7 17:22:55 CEST 2020


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

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jonathan.druart at bugs.koha-c
                   |                            |ommunity.org

--- Comment #3 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Lari Taskula from comment #1)
> I start from where we left off at Bug 22887 comment 28.
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22887#c28
> 
> (In reply to Jonathan Druart from comment #28)
> > It is what we are doing for years.
> 
> I can find only one occurrence that conditionally either alters the schema
> or not, and leaves the admin with only a warning. And that was 12 days ago
> by Bug 18177.

Yes, that is what I meant, we usually do not deal with errors. We drop the
column (with data or not), we add the FK without checking if it will be created
or not.

What is needed here is to surround each of our entry with an eval and catch any
errors raised by the DBMS. If there is an error, we stop the update process and
raise the error to the interface/script, waiting for the situation to be
unblocked.

On the other hand I can imagine that one could want to get all the errors at
once, and deal with them in one go. That's the behavior what I would like to
get if I had to deal with upgrade process. In that case I imagine a switch
would be needed.

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


More information about the Koha-bugs mailing list