From 2427f89dfefad8c612707bfaf434bfc689845ae7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 2 Feb 2026 12:21:05 +0000 Subject: [PATCH] Bug 38769: Add consents column to borrower_modifications Add a new 'consents' column to the borrower_modifications table to store JSON-encoded plugin consents during self-registration when email verification is enabled. This allows plugin consents to be stored alongside other patron data during the email verification workflow and processed after the patron verifies their email address. --- .../data/mysql/atomicupdate/bug_38769.pl | 23 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 24 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_38769.pl diff --git a/installer/data/mysql/atomicupdate/bug_38769.pl b/installer/data/mysql/atomicupdate/bug_38769.pl new file mode 100644 index 00000000000..d975ca84522 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_38769.pl @@ -0,0 +1,23 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "38769", + description => "Add consents column to borrower_modifications for plugin consent storage", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'borrower_modifications', 'consents' ) ) { + $dbh->do( + q{ + ALTER TABLE borrower_modifications + ADD COLUMN `consents` mediumtext DEFAULT NULL + COMMENT 'JSON-encoded plugin consents for self-registration' + AFTER `extended_attributes` + } + ); + say $out "Added column 'borrower_modifications.consents'"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 733015e6e22..8826fda327d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1477,6 +1477,7 @@ CREATE TABLE `borrower_modifications` ( `smsalertnumber` varchar(50) DEFAULT NULL, `privacy` int(11) DEFAULT NULL, `extended_attributes` mediumtext DEFAULT NULL, + `consents` mediumtext DEFAULT NULL COMMENT 'JSON-encoded plugin consents for self-registration', `gdpr_proc_consent` datetime DEFAULT NULL COMMENT 'data processing consent', `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes', `lang` varchar(25) DEFAULT NULL, -- 2.52.0