Bug 29605: search_marc_map.marc_type
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 2 Dec 2021 11:37:33 +0000 (12:37 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 2 Feb 2022 07:39:39 +0000 (21:39 -1000)
NOT NULL was missing when MODIFY

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/atomicupdate/bug_29605.pl
installer/data/mysql/db_revs/210600031.pl

index d07fc1f..c1febb4 100755 (executable)
@@ -59,6 +59,9 @@ return {
         );
         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'});
+        say $out "Ensure NOT NULL on search_marc_map.marc_type";
+
     },
 
 }
index 5c92ad7..c624509 100755 (executable)
@@ -7,6 +7,6 @@ return {
         my ($args) = @_;
         my ($dbh, $out) = @$args{qw(dbh out)};
         $dbh->do(q{DELETE FROM search_marc_map WHERE marc_type='normarc'});
-        $dbh->do(q{ALTER TABLE search_marc_map MODIFY `marc_type` enum('marc21','unimarc') COMMENT 'what MARC type this map is for'});
+        $dbh->do(q{ALTER TABLE search_marc_map MODIFY `marc_type` enum('marc21','unimarc') NOT NULL COMMENT 'what MARC type this map is for'});
     },
 }