From ad6e72dddddd29ed3330f0c282b754d941c53d95 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. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- 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 6e8e1147ee..dd2a4dd0ad 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2637,7 +2637,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.39.5