From bb718a6fdffa8bc5374b418b88bab35787e6365f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 May 2025 12:53:10 +0200 Subject: [PATCH] Bug 38663: Fix columns order in db_rev --- installer/data/mysql/db_revs/241200018.pl | 3 ++- installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/db_revs/241200018.pl b/installer/data/mysql/db_revs/241200018.pl index 64cb35e89d8..00641527959 100755 --- a/installer/data/mysql/db_revs/241200018.pl +++ b/installer/data/mysql/db_revs/241200018.pl @@ -18,7 +18,8 @@ return { say_info( $out, "Converting record_id from int(11) to VARCHAR(11)...\n" ); $dbh->do( - q{ ALTER TABLE additional_field_values ADD COLUMN new_record_id VARCHAR(11) NOT NULL DEFAULT ''; }); + q{ ALTER TABLE additional_field_values ADD COLUMN new_record_id VARCHAR(11) NOT NULL DEFAULT '' COMMENT "record_id" AFTER field_id; } + ); $dbh->do(q{ UPDATE additional_field_values SET new_record_id = CAST(record_id AS CHAR(11)); }); $dbh->do(q{ ALTER TABLE additional_field_values DROP COLUMN record_id; }); $dbh->do(q{ ALTER TABLE additional_field_values RENAME COLUMN new_record_id TO record_id; }); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c9b953ef43f..795aaee4881 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(11) NOT NULL DEFAULT '' COMMENT 'record_id', `value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field', PRIMARY KEY (`id`), KEY `afv_fk` (`field_id`), -- 2.34.1