From cf8b43b8e3207dc8128517b69ee61e7392f0c0fd Mon Sep 17 00:00:00 2001
From: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Date: Thu, 25 Mar 2021 14:29:06 +0000
Subject: [PATCH] Bug 27726: (ALTERNATIVE) Increase 'content' field size

This alternate patch increases the field size from a 255 character
varchar to a 65535 character text field. This allows for more detailed
problem reports to be submitted.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 installer/data/mysql/atomicupdate/bug_27726.perl | 6 ++++++
 installer/data/mysql/kohastructure.sql           | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 installer/data/mysql/atomicupdate/bug_27726.perl

diff --git a/installer/data/mysql/atomicupdate/bug_27726.perl b/installer/data/mysql/atomicupdate/bug_27726.perl
new file mode 100644
index 0000000000..4e993aa92d
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug_27726.perl
@@ -0,0 +1,6 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do("ALTER TABLE problem_reports MODIFY content TEXT NOT NULL DEFAULT ''");
+
+    NewVersion( $DBversion, 27726, "Increase field size for problem_reports.content");
+}
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index ae247e67c8..f78a5dc23c 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -4132,7 +4132,7 @@ DROP TABLE IF EXISTS `problem_reports`;
 CREATE TABLE `problem_reports` (
   `reportid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier assigned by Koha',
   `title` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'report subject line',
-  `content` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'report message content',
+  `content` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'report message content',
   `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'the user who created the problem report',
   `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'borrower''s branch',
   `username` varchar(75) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'OPAC username',
-- 
2.11.0