[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
Mon Apr 25 12:41:15 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27253

--- Comment #18 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 133735
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133735&action=edit
Bug 27253: (follow-up) Fix UNIXTIME(0) in db_revs/211200037.pl

MariaDB [koha_myclone]> update borrowers set updated_on=COALESCE( NULL,
FROM_UNIXTIME(0) ) where borrowernumber=51;
ERROR 1292 (22007): Incorrect datetime value: '1970-01-01 00:00:00' for column
`koha_myclone`.`borrowers`.`updated_on` at row 1

MariaDB [koha_myclone]> update borrowers set updated_on=COALESCE( NULL,
FROM_UNIXTIME(1) ) where borrowernumber=51;
Query OK, 1 row affected (0.008 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Tested by switching updated_on to datetime. Remove NOT NULL, etc.
Copied dbrev to atomicupdate folder.
Resulted in:
    Updated all NULL values of borrowers.updated_on to GREATEST(date_renewed,
dateenrolled, lastseen): 51 rows updated

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list