From ededeeef41a23b0f0aa0b7e6d218dbec8b980479 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 20 Feb 2025 11:28:15 +0000 Subject: [PATCH] Bug 38457: Update record_id to VARCHAR(80) This is required to allow for long primary keys from the account_debit_types table. --- installer/data/mysql/atomicupdate/bug_38457.pl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_38457.pl diff --git a/installer/data/mysql/atomicupdate/bug_38457.pl b/installer/data/mysql/atomicupdate/bug_38457.pl new file mode 100755 index 00000000000..4f7cb4f9efc --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_38457.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "38457", + description => "Add additional fields to debit types", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do(q{ ALTER TABLE additional_field_values MODIFY record_id VARCHAR(80) NOT NULL DEFAULT ''; }); + + say $out "Converted record_id to VARCHAR(80)"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 9b7dc7fc6ec..77f2f293910 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -247,7 +247,7 @@ DROP TABLE IF EXISTS `additional_field_values`; CREATE TABLE `additional_field_values` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier', `field_id` int(11) NOT NULL COMMENT 'foreign key references additional_fields(id)', - `record_id` varchar(11) NOT NULL COMMENT 'record_id', + `record_id` varchar(80) NOT NULL COMMENT 'record_id', `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field', PRIMARY KEY (`id`), KEY `afv_fk` (`field_id`), -- 2.49.0