From ee5bfeddc1f570f0d30ec0aa4235127b8f992264 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 6 Mar 2020 11:20:51 +0000 Subject: [PATCH] Bug 24818: Update database accountlines.date to timestamp This update increases the resolution for the 'date' field, used for 'creation date' in accountlines from a 'date' to a 'timestamp'. This matches other tables where both a created and updated field are included. --- installer/data/mysql/atomicupdate/bug_24818.perl | 8 ++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24818.perl diff --git a/installer/data/mysql/atomicupdate/bug_24818.perl b/installer/data/mysql/atomicupdate/bug_24818.perl new file mode 100644 index 0000000000..773f65d2b4 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24818.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + $dbh->do( "ALTER TABLE accountlines MODIFY COLUMN date TIMESTAMP NULL" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24818: Update 'accountlines.date' from DATE to TIMESTAMP)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 5cb56ae2fd..a4202c4df5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2650,7 +2650,7 @@ CREATE TABLE `accountlines` ( `issue_id` int(11) NULL DEFAULT NULL, `borrowernumber` int(11) DEFAULT NULL, `itemnumber` int(11) default NULL, - `date` date default NULL, + `date` timestamp NULL, `amount` decimal(28,6) default NULL, `description` LONGTEXT, `credit_type_code` varchar(80) default NULL, -- 2.20.1