From 779df7f72805bebed9c8ef4e1f5d5f3caf64931c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2020 14:05:13 +0200 Subject: [PATCH] Bug 21066: DBRev 20.06.00.033 --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_21066.perl | 16 ------------- .../data/mysql/atomicupdate/bug_21066b.perl | 9 ------- installer/data/mysql/updatedatabase.pl | 24 +++++++++++++++++++ 4 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21066.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_21066b.perl diff --git a/Koha.pm b/Koha.pm index be102282dd..f21c90588c 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 = "20.06.00.032"; +$VERSION = "20.06.00.033"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_21066.perl b/installer/data/mysql/atomicupdate/bug_21066.perl deleted file mode 100644 index 630f6d270b..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21066.perl +++ /dev/null @@ -1,16 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - if( column_exists( 'opac_news', 'timestamp' ) ) { - $dbh->do(q| - ALTER TABLE opac_news - CHANGE COLUMN timestamp publicationdate date DEFAULT NULL - |); - } - if( !column_exists( 'opac_news', 'updated_on' ) ) { - $dbh->do(q| - ALTER TABLE opac_news - ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER publicationdate - |); - } - NewVersion( $DBversion, 21066, "Update table opac_news"); -} diff --git a/installer/data/mysql/atomicupdate/bug_21066b.perl b/installer/data/mysql/atomicupdate/bug_21066b.perl deleted file mode 100644 index d99e79c54f..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21066b.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do(q| - UPDATE letter - SET content = REPLACE(content,?,?) - WHERE content LIKE ? - |, undef, 'opac_news.timestamp', 'opac_news.publicationdate', '%opac_news.timestamp%' ); - NewVersion( $DBversion, 21066, "Replace timestamp references in letters table"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0a068f3f46..e6ea662310 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -22725,6 +22725,30 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 19889, "Add exclude_from_local_holds_priority column to items, deleteditems and categories tables"); } +$DBversion = '20.06.00.033'; +if( CheckVersion( $DBversion ) ) { + if( column_exists( 'opac_news', 'timestamp' ) ) { + $dbh->do(q| + ALTER TABLE opac_news + CHANGE COLUMN timestamp publicationdate date DEFAULT NULL + |); + } + if( !column_exists( 'opac_news', 'updated_on' ) ) { + $dbh->do(q| + ALTER TABLE opac_news + ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER publicationdate + |); + } + + $dbh->do(q| + UPDATE letter + SET content = REPLACE(content,?,?) + WHERE content LIKE ? + |, undef, 'opac_news.timestamp', 'opac_news.publicationdate', '%opac_news.timestamp%' ); + + NewVersion( $DBversion, 21066, ["Update table opac_news", "Replace timestamp references in letters 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.20.1