From 526606901626082831ab501609cf05e360551ce1 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 29 Jul 2022 06:53:06 -0400 Subject: [PATCH] Bug 30984: (QA follow-up) Switch from mediumtext to varchar(255) My research indeicates that tinytext of less than 40 bytes uses about the same storage as a varchar(255). Also, using a TEXT field in a complex query may create a temp table. varchar fields are also more efficient for sorting on. Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_30984.pl | 2 +- installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_30984.pl b/installer/data/mysql/atomicupdate/bug_30984.pl index 6947bcf734..2c5df5d07c 100755 --- a/installer/data/mysql/atomicupdate/bug_30984.pl +++ b/installer/data/mysql/atomicupdate/bug_30984.pl @@ -9,7 +9,7 @@ return { if( !column_exists( 'action_logs', 'script' ) ) { $dbh->do(q{ ALTER TABLE action_logs - ADD COLUMN script mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the name of the cron script that caused this change' + ADD COLUMN script varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the name of the cron script that caused this change' AFTER interface }); } diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3eb8c332f9..1b1e5f52d4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -175,7 +175,7 @@ CREATE TABLE `action_logs` ( `object` int(11) DEFAULT NULL COMMENT 'the object that the action was taken against (could be a borrowernumber, itemnumber, etc)', `info` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'information about the action (usually includes SQL statement)', `interface` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the context this action was taken in', - `script` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the name of the cron script that caused this change', + `script` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the name of the cron script that caused this change', PRIMARY KEY (`action_id`), KEY `timestamp_idx` (`timestamp`), KEY `user_idx` (`user`), -- 2.39.5