Bug 20773 - bug 20724 follow-up - Database cleanup
Summary: bug 20724 follow-up - Database cleanup
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 20724
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-16 14:20 UTC by Jonathan Druart
Modified: 2018-09-24 13:12 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20773: (bug 20724 follow-up) Add a simple db revision (1.47 KB, patch)
2018-05-16 14:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20773: (followup) Remove MySQLism (1.40 KB, patch)
2018-07-13 09:50 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20773: (bug 20724 follow-up) Add a simple db revision (1.53 KB, patch)
2018-08-14 10:09 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 20773: (bug 20724 follow-up) Add a simple db revision (2.12 KB, patch)
2018-08-14 10:11 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 20773: (followup) Remove MySQLism (1.45 KB, patch)
2018-08-14 10:12 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 20773: (bug 20724 follow-up) Add a simple db revision (2.18 KB, patch)
2018-08-21 09:30 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 20773: (followup) Remove MySQLism (1.51 KB, patch)
2018-08-21 09:35 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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