[Koha-bugs] [Bug 27253] borrowers.updated_on cannot be null on fresh install, but can be null with upgrade
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Apr 15 09:39:56 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27253
Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #132934|0 |1
is obsolete| |
--- Comment #8 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 133342
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133342&action=edit
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 at myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list