From 219f000069377f8a6b2790e42870083236b66bd0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 4 May 2020 07:46:00 +0100 Subject: [PATCH] Bug 17355: DBRev 19.12.00.083 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_17355.perl | 25 ------------------ installer/data/mysql/updatedatabase.pl | 26 +++++++++++++++++++ 3 files changed, 27 insertions(+), 26 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_17355.perl diff --git a/Koha.pm b/Koha.pm index 2a4f761ed2..28365c8128 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "19.12.00.082"; +$VERSION = "19.12.00.083"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_17355.perl b/installer/data/mysql/atomicupdate/bug_17355.perl deleted file mode 100644 index 5720f2872d..0000000000 --- a/installer/data/mysql/atomicupdate/bug_17355.perl +++ /dev/null @@ -1,25 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - unless ( column_exists( 'authorised_value_categories', 'is_system' ) ) { - $dbh->do(q| - ALTER TABLE authorised_value_categories - ADD COLUMN is_system TINYINT(1) DEFAULT 0 AFTER category_name - |); - } - - $dbh->do(q| - UPDATE authorised_value_categories - SET is_system = 1 - WHERE category_name IN ('LOC', 'LOST', 'WITHDRAWN', 'Bsort1', 'Bsort2', 'Asort1', 'Asort2', 'SUGGEST', 'DAMAGED', 'LOST', 'BOR_NOTES', 'CCODE', 'NOT_LOAN') - |); - - $dbh->do(q| - UPDATE authorised_value_categories - SET is_system = 1 - WHERE category_name IN ('branches', 'itemtypes', 'cn_source') - |); - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 17355, "Add is_system to authorised_value_categories table"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a4b71847f3..042185af55 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21941,6 +21941,32 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 23794, \@detail); } +$DBversion = '19.12.00.083'; +if( CheckVersion( $DBversion ) ) { + + unless ( column_exists( 'authorised_value_categories', 'is_system' ) ) { + $dbh->do(q| + ALTER TABLE authorised_value_categories + ADD COLUMN is_system TINYINT(1) DEFAULT 0 AFTER category_name + |); + } + + $dbh->do(q| + UPDATE authorised_value_categories + SET is_system = 1 + WHERE category_name IN ('LOC', 'LOST', 'WITHDRAWN', 'Bsort1', 'Bsort2', 'Asort1', 'Asort2', 'SUGGEST', 'DAMAGED', 'LOST', 'BOR_NOTES', 'CCODE', 'NOT_LOAN') + |); + + $dbh->do(q| + UPDATE authorised_value_categories + SET is_system = 1 + WHERE category_name IN ('branches', 'itemtypes', 'cn_source') + |); + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 17355, "Add is_system to authorised_value_categories table"); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5