Koha/installer/data/mysql
Julian Maurice eb2ca283d6 Bug 27253: Fix definition of updated_on in borrowers and deletedborrowers
Test plan:
1. First you have to be in a state where updated_on is NULL-able. You
   can do that by either:
   a) do a fresh install of Koha 16.05 and update to master, or
   b) execute the following SQL queries:

     ALTER TABLE borrowers MODIFY updated_on timestamp NULL
     DEFAULT current_timestamp() ON UPDATE current_timestamp()
     COMMENT 'time of last change could be useful for synchronization
     with external systems (among others)'

     ALTER TABLE deletedborrowers MODIFY updated_on timestamp NULL
     DEFAULT current_timestamp() ON UPDATE current_timestamp()
     COMMENT 'time of last change could be useful for synchronization
     with external systems (among others)'
2. Create two borrowers (let's name them X and Y)
3. Delete borrower Y
4. Set the column updated_on to NULL for both borrowers by executing the
   following SQL query:
   UPDATE borrowers SET updated_on = NULL WHERE borrowernumber =
   <borrowernumber of X>
   UPDATE deletedborrowers SET updated_on = NULL WHERE borrowernumber =
   <borrowernumber of Y>
5. Apply patch and run updatedatabase
6. Verify that borrowers.updated_on and deletedborrowers.updated_on are
   not NULL-able.
   Verify that updated_on for X and Y have taken the value of
   dateenrolled.
7. Repeat step 2 to 6 but this time renew the patron and/or log in with
   its account in order to set the columns borrowers.date_renewed and
   borrowers.lastseen before executing updatedatabase
   borrowers.updated_on should take the greatest value among
   dateenrolled, date_renewed, and lastseen

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-21 21:01:09 -10:00
..
atomicupdate Bug 27253: Fix definition of updated_on in borrowers and deletedborrowers 2022-04-21 21:01:09 -10:00
db_revs Bug 28786: DBRev 21.12.00.036 2022-04-20 20:43:15 -10:00
en Bug 30373: (follow-up) Fix license 2022-04-21 21:01:09 -10:00
fr-FR Bug 30237: (follow-up) Add french sample notice 2022-04-20 09:03:39 -10:00
localization Bug 27622: Add stuffs to custom.sql 2021-10-07 15:49:01 +02:00
mandatory Bug 30373: Add TYPEDOC authorised_values_category 2022-04-21 13:41:35 -10:00
backfill_statistics.pl
fix_unclosed_nonaccruing_fines_bug17135.pl
kohastructure.sql Bug 28786: Add new DB column borrowers.auth_method 2022-04-20 20:43:15 -10:00
labels_upgrade.pl
patroncards_upgrade.pl
update22to30.pl Bug 29180: (QA follow-up) Don't alter old DB up date 2021-11-05 12:13:25 +01:00
updatedatabase.pl Bug 28263: Fix too_many auto renewal message 2021-11-02 16:50:01 +01:00