@@ -, +, @@ --- installer/data/mysql/db_revs/211200005.pl | 23 +++++++++++++---------- installer/data/mysql/db_revs/211200013.pl | 12 +++++++----- 2 files changed, 20 insertions(+), 15 deletions(-) --- a/installer/data/mysql/db_revs/211200005.pl +++ a/installer/data/mysql/db_revs/211200005.pl @@ -6,15 +6,18 @@ return { up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - $dbh->do(q{ - DELETE FROM additional_contents - WHERE code NOT IN ( - SELECT code FROM ( - SELECT code - FROM additional_contents - WHERE lang = "default" - ) as tmp - ); - }); + # Run this only if 230600041 has not been run before + if ( column_exists('additional_contents', 'lang') ) { + $dbh->do(q{ + DELETE FROM additional_contents + WHERE code NOT IN ( + SELECT code FROM ( + SELECT code + FROM additional_contents + WHERE lang = "default" + ) as tmp + ); + }); + } }, } --- a/installer/data/mysql/db_revs/211200013.pl +++ a/installer/data/mysql/db_revs/211200013.pl @@ -48,11 +48,13 @@ return { }); say $out "Ensure additional_contents.code is VARCHAR(100)"; - $dbh->do(q{ - ALTER TABLE `additional_contents` - MODIFY COLUMN `lang` VARCHAR(50) NOT NULL DEFAULT '' - }); - say $out "Ensure additional_contents.lang is VARCHAR(50)"; + if ( column_exists('additional_contents', 'lang') ) { + $dbh->do(q{ + ALTER TABLE `additional_contents` + MODIFY COLUMN `lang` VARCHAR(50) NOT NULL DEFAULT '' + }); + say $out "Ensure additional_contents.lang is VARCHAR(50)"; + } $dbh->do(q{ ALTER TABLE search_marc_map MODIFY `marc_type` enum('marc21','unimarc') NOT NULL COMMENT 'what MARC type this map is for' --