From c7884b708cf254f51975ad829b0e1dca053307a0 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 --- 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 21f6ec015c..54088e2948 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4636,7 +4636,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.30.2