Bug 28301

Summary: Add ability to force re-run of a particular DB update
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Installation and upgrade (command-line installer)Assignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, dcook, fridolin.somers, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 28301: Add forced run of particular DB update

Description Nick Clemens (kidclamp) 2021-05-07 13:06:37 UTC
When there are errors in the updates it would be nice to have a way to execute a single DB update easily
Comment 1 Nick Clemens (kidclamp) 2021-05-07 13:11:51 UTC
Created attachment 120689 [details] [review]
Bug 28301: Add forced run of particular DB update

This patch adds a --forcedversion option to the updatedatabase script
in order to allow testing of a particular update

To test:
1 - Apply patch
2 - Pick a DB update that will fail if rerun
3 - perl /kohadevbox/koha/installer/data/mysql/updatedatabase.pl --forcedversion="3.21.00.041"
4 - Confirm it ran, you should get an error :-)
5 - Check the version system preference, confirm it is unchanged
    SELECT value FROM systempreference WHERE variable='Version';
Comment 2 Jonathan Druart 2021-07-16 09:50:56 UTC
Can you rebase it on top of bug 25078 please?
If it can wait I can do it when it's pushed to master.
Comment 3 Fridolin Somers 2022-03-10 07:21:22 UTC
Very interesting.

Needs rewrite since bug 25078 right ?
Comment 4 Jonathan Druart 2022-03-17 14:27:40 UTC
I think it's actually no longer needed with bug 25078.
Comment 5 Fridolin Somers 2022-03-18 00:20:53 UTC
(In reply to Jonathan Druart from comment #4)
> I think it's actually no longer needed with bug 25078.

But how do you run a particular DBRev perl file ?
Comment 6 Jonathan Druart 2022-03-18 08:24:17 UTC
(In reply to Fridolin Somers from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > I think it's actually no longer needed with bug 25078.
> 
> But how do you run a particular DBRev perl file ?

What would be the use case?
Now the update process stops when an error happens.
Comment 7 Fridolin Somers 2022-03-18 09:07:12 UTC
For example checking that it can be run several times.
Comment 8 Jonathan Druart 2022-03-18 09:20:38 UTC
(In reply to Fridolin Somers from comment #7)
> For example checking that it can be run several times.

It should be done when it's still an atomic update :)
Once it's in dbrev, such test should have been done already.

I am not against the idea, but I don't understand what it will bring us.
Comment 9 Fridolin Somers 2022-03-18 09:29:15 UTC
(In reply to Jonathan Druart from comment #8)
> It should be done when it's still an atomic update :)
Ahhhh correct
Comment 10 David Nind 2022-06-01 06:14:40 UTC
Is this bug still relevant (from the comments)?

If it is, I will have a go at testing...
Comment 11 Jonathan Druart 2022-06-01 06:57:34 UTC
I don't think so. Nick, please reopen if you disagree.