]> git.koha-community.org Git - koha.git/commit
Bug 27253: (follow-up) Fix UNIXTIME(0) in db_revs/211200037.pl
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 25 Apr 2022 10:29:05 +0000 (10:29 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 25 Apr 2022 20:00:22 +0000 (10:00 -1000)
commitfb41768d9fac8d4eb4bff171019ce43acab4a400
treec5af72cf0179fc03041439b10a57df380e709a48
parent7d71fb052a56037086fdae2704fafe75673c1019
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@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

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/db_revs/211200037.pl