From d1f366f2cbbf36b66728ae32410cac12b889833b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 28 Oct 2021 11:45:39 +0000 Subject: [PATCH] Bug 29336: Identify the fields with wrong length (or name) first This report will fix the bad lengths first. And mark the 'bad' names with a TODO for follow-up. Bad name means: refers to value, should be category. Scanning kohastructure.sql. Note: Bug 29347 has been opened to fix the names. Test plan: Search for another AV category field with length<>32. Bonus: Reinstall and check database. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall (cherry picked from commit e9f0123b6d5a4bf705ac6bf0971ae053a8ef81de) Signed-off-by: Andrew Fuerste-Henry --- installer/data/mysql/kohastructure.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0687a6c2fc..9809e53d38 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -225,7 +225,7 @@ CREATE TABLE `additional_fields` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier', `tablename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'tablename of the new field', `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'name of the field', - `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'is an authorised value category', + `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'is an authorised value category', `marcfield` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'contains the marc field to copied into the record', `searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the field searchable?', PRIMARY KEY (`id`), @@ -835,7 +835,7 @@ CREATE TABLE `auth_subfield_structure` ( `repeatable` tinyint(4) NOT NULL DEFAULT 0, `mandatory` tinyint(4) NOT NULL DEFAULT 0, `tab` tinyint(1) DEFAULT NULL, - `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '#TODO This is a AV category!', `value_builder` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `seealso` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `isurl` tinyint(1) DEFAULT NULL, @@ -865,7 +865,7 @@ CREATE TABLE `auth_tag_structure` ( `libopac` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `repeatable` tinyint(4) NOT NULL DEFAULT 0, `mandatory` tinyint(4) NOT NULL DEFAULT 0, - `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '#TODO This is a AV category!', PRIMARY KEY (`authtypecode`,`tagfield`), CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -1877,7 +1877,7 @@ CREATE TABLE `club_template_enrollment_fields` ( `club_template_id` int(11) NOT NULL, `name` text COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `club_template_id` (`club_template_id`), CONSTRAINT `club_template_enrollment_fields_ibfk_1` FOREIGN KEY (`club_template_id`) REFERENCES `club_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -1896,7 +1896,7 @@ CREATE TABLE `club_template_fields` ( `club_template_id` int(11) NOT NULL, `name` text COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `club_template_id` (`club_template_id`), CONSTRAINT `club_template_fields_ibfk_1` FOREIGN KEY (`club_template_id`) REFERENCES `club_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -3452,7 +3452,7 @@ CREATE TABLE `marc_subfield_structure` ( `important` tinyint(4) NOT NULL DEFAULT 0, `kohafield` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `tab` tinyint(1) DEFAULT NULL, - `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '#TODO This is a AV category!', `authtypecode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `value_builder` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `isurl` tinyint(1) DEFAULT NULL, @@ -3486,7 +3486,7 @@ CREATE TABLE `marc_tag_structure` ( `repeatable` tinyint(4) NOT NULL DEFAULT 0, `mandatory` tinyint(4) NOT NULL DEFAULT 0, `important` tinyint(4) NOT NULL DEFAULT 0, - `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '#TODO This is a AV category!', `ind1_defaultvalue` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `ind2_defaultvalue` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `frameworkcode` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', -- 2.39.5