From 05fb6f7848ee5bb723b48f4f5123d0359d4a6da5 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 29 Aug 2023 14:09:09 +0200 Subject: [PATCH] Bug 31503: Change patron_consent.type Test plan: Run db rev. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug31503.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug31503.pl diff --git a/installer/data/mysql/atomicupdate/bug31503.pl b/installer/data/mysql/atomicupdate/bug31503.pl new file mode 100755 index 0000000000..25871e187f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug31503.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => 31503, + description => "Change patron_consent.type", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ALTER TABLE `patron_consent` MODIFY `type` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'consent type, could be custom type'} + ); + + say $out "Changed column 'patron_consent.type'"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 394b57e48c..c5655ec2cf 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4690,7 +4690,7 @@ DROP TABLE IF EXISTS `patron_consent`; CREATE TABLE `patron_consent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `borrowernumber` int(11) NOT NULL, - `type` enum('GDPR_PROCESSING') DEFAULT NULL COMMENT 'allows for future extension', + `type` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'consent type, could be custom type', `given_on` datetime DEFAULT NULL, `refused_on` datetime DEFAULT NULL, PRIMARY KEY (`id`), -- 2.39.5