From 6d7aa694a92781e7df61d9dd60d0ff14f891a52b Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 12 Apr 2022 12:09:05 +0200 Subject: [PATCH] Bug 26346: DBRev 21.12.00.027 Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_26346.perl | 9 --------- installer/data/mysql/db_revs/211200027.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 10 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_26346.perl create mode 100755 installer/data/mysql/db_revs/211200027.pl diff --git a/Koha.pm b/Koha.pm index bd14f9194c..48a5686160 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 = "21.12.00.026"; +$VERSION = "21.12.00.027"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_26346.perl b/installer/data/mysql/atomicupdate/bug_26346.perl deleted file mode 100644 index 6d97a28906..0000000000 --- a/installer/data/mysql/atomicupdate/bug_26346.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; -if ( CheckVersion($DBversion) ) { - if ( !column_exists( 'virtualshelves', 'allow_change_from_staff' ) ) { - $dbh->do(q{ALTER TABLE virtualshelves ADD COLUMN `allow_change_from_staff` tinyint(1) DEFAULT '0' COMMENT 'can staff change contents?'}); - } - - $dbh->do(q{ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (20, 'edit_public_lists', 'Edit public lists') }); - NewVersion( $DBversion, 26346, "Add allow_change_from_staff to virtualshelves table" ); -} diff --git a/installer/data/mysql/db_revs/211200027.pl b/installer/data/mysql/db_revs/211200027.pl new file mode 100755 index 0000000000..c6257a60e0 --- /dev/null +++ b/installer/data/mysql/db_revs/211200027.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +return { + bug_number => "26346", + description => "Add allow_change_from_staff to virtualshelves table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if ( !column_exists( 'virtualshelves', 'allow_change_from_staff' ) ) { + $dbh->do(q{ + ALTER TABLE virtualshelves ADD COLUMN `allow_change_from_staff` tinyint(1) DEFAULT '0' COMMENT 'can staff change contents?' + }); + } + $dbh->do(q{ + INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (20, 'edit_public_lists', 'Edit public lists') + }); + }, +}; -- 2.39.5