From e56b12197dfa5cb7d9f9e5b7a89744ece0a0a28d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Dec 2020 18:11:35 +0100 Subject: [PATCH] Bug 8976: Add marc_subfield_structure.display_order Sponsored-by: Orex Digital Signed-off-by: Michal Denar Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_8976.perl | 13 +++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 14 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_8976.perl diff --git a/installer/data/mysql/atomicupdate/bug_8976.perl b/installer/data/mysql/atomicupdate/bug_8976.perl new file mode 100644 index 00000000000..a16c555bc08 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8976.perl @@ -0,0 +1,13 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + unless ( column_exists( 'marc_subfield_structure', 'display_order' ) ) { + $dbh->do(q{ + ALTER TABLE marc_subfield_structure + ADD COLUMN display_order INT(2) NOT NULL DEFAULT 0 AFTER maxlength + }); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, XXXXX, "Description"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 952cd9d2961..033a6f505af 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3454,6 +3454,7 @@ CREATE TABLE `marc_subfield_structure` ( `link` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `defaultvalue` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `maxlength` int(4) NOT NULL DEFAULT 9999, + `display_order` int(2) NOT NULL DEFAULT 0, PRIMARY KEY (`frameworkcode`,`tagfield`,`tagsubfield`), KEY `kohafield_2` (`kohafield`), KEY `tab` (`frameworkcode`,`tab`), -- 2.30.1