Bug 20773

Summary: bug 20724 follow-up - Database cleanup
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: DatabaseAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: fridolin.somers, katrin.fischer, m.de.rooy, martin.renvoize, nick, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 20724    
Bug Blocks:    
Attachments: Bug 20773: (bug 20724 follow-up) Add a simple db revision
Bug 20773: (followup) Remove MySQLism
Bug 20773: (bug 20724 follow-up) Add a simple db revision
Bug 20773: (bug 20724 follow-up) Add a simple db revision
Bug 20773: (followup) Remove MySQLism
Bug 20773: (bug 20724 follow-up) Add a simple db revision
Bug 20773: (followup) Remove MySQLism

Description Jonathan Druart 2018-05-16 14:20:21 UTC

    
Comment 1 Jonathan Druart 2018-05-16 14:20:52 UTC
Created attachment 75368 [details] [review]
Bug 20773: (bug 20724 follow-up) Add a simple db revision

We should correct bad data too.
This is a trivial, pragmatic approach. Instead of doing a complex
calculation with holidays etc. (as was done on 12063), we just add
MaxPickupDelay or 7 days to today probably resulting in a little bonus
time. Only for waiting holds. When the ReservesNeedReturns pref was not
Automatic, there should be no changes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Jonathan Druart 2018-05-16 14:22:08 UTC
This change contains MySQLism (FQA)

And maybe it would be better to display a warning and provide a script to fix the data (In Discussion).
Comment 3 Martin Renvoize 2018-07-13 09:50:13 UTC
Created attachment 76939 [details] [review]
Bug 20773: (followup) Remove MySQLism
Comment 4 Victor Grousset/tuxayo 2018-08-14 10:09:23 UTC Comment hidden (obsolete)
Comment 5 Victor Grousset/tuxayo 2018-08-14 10:11:59 UTC
Created attachment 77779 [details] [review]
Bug 20773: (bug 20724 follow-up) Add a simple db revision

We should correct bad data too.
This is a trivial, pragmatic approach. Instead of doing a complex
calculation with holidays etc. (as was done on 12063), we just add
MaxPickupDelay or 7 days to today probably resulting in a little bonus
time. Only for waiting holds. When the ReservesNeedReturns pref was not
Automatic, there should be no changes.

== Test plan ==
1. git checkout c585f1149770ec401f188e061211501897cec0bf~1
     This the commit before bug 20724's patches.
     We need that to be able to generate "corrupted data"
2. Set ReservesNeedReturns to "Automatically"
3. Place a hold on a specific item
4. The hold should have an *empty* expiration date
     record page → Hold → "Expiration" column
5. Apply this patch
6. Run updatedatabase.pl
7. Refresh the page
8. The hold should have an expiration date (not empty)
9. Celebrate! 🎉🎊🥳

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Comment 6 Victor Grousset/tuxayo 2018-08-14 10:12:02 UTC
Created attachment 77780 [details] [review]
Bug 20773: (followup) Remove MySQLism

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Comment 7 Katrin Fischer 2018-08-16 05:53:40 UTC
Assignee is missing - Marcel or Martin? :)
Comment 8 Chris Cormack 2018-08-21 09:30:50 UTC
Created attachment 78036 [details] [review]
Bug 20773: (bug 20724 follow-up) Add a simple db revision

We should correct bad data too.
This is a trivial, pragmatic approach. Instead of doing a complex
calculation with holidays etc. (as was done on 12063), we just add
MaxPickupDelay or 7 days to today probably resulting in a little bonus
time. Only for waiting holds. When the ReservesNeedReturns pref was not
Automatic, there should be no changes.

== Test plan ==
1. git checkout c585f1149770ec401f188e061211501897cec0bf~1
     This the commit before bug 20724's patches.
     We need that to be able to generate "corrupted data"
2. Set ReservesNeedReturns to "Automatically"
3. Place a hold on a specific item
4. The hold should have an *empty* expiration date
     record page → Hold → "Expiration" column
5. Apply this patch
6. Run updatedatabase.pl
7. Refresh the page
8. The hold should have an expiration date (not empty)
9. Celebrate! 🎉🎊🥳

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 9 Chris Cormack 2018-08-21 09:35:40 UTC
Created attachment 78038 [details] [review]
Bug 20773: (followup) Remove MySQLism

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 10 Nick Clemens 2018-08-21 13:55:34 UTC
Awesome work all!

Pushed to master for 18.11
Comment 11 Martin Renvoize 2018-08-24 09:07:44 UTC
Pushed to 18.05.x for 18.05.03
Comment 12 Fridolin Somers 2018-08-27 13:07:45 UTC
Pushed to 17.11.x for 17.11.09
Comment 13 Fridolin Somers 2018-09-24 13:12:26 UTC
Pushed to 17.05.x for 17.05.14