Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
chore(release): merge hotfix-mon-15318 in 21.10.x (#11948)
Browse files Browse the repository at this point in the history
* update version to 21.10.12 in insertBaseConf

* fixed issue where notification number < 0 before update (#11935)

Co-authored-by: dmyios <[email protected]>

Refs: MON-15318

* add php update file for 21.10.12

Co-authored-by: Kevin Duret <[email protected]>
  • Loading branch information
tuntoja and kduret authored Oct 7, 2022
1 parent 59a70af commit a487b58
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/install/insertBaseConf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Insert version
--

INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '21.10.11');
INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '21.10.12');

--
-- Contenu de la table `contact`
Expand Down
8 changes: 8 additions & 0 deletions www/install/php/Update-21.10.11.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@
try {
$errorMessage = "Impossible to update 'hosts' table";
if (! str_contains(strtolower($pearDBO->getColumnType('hosts', 'notification_number')), 'bigint')) {
$pearDBO->beginTransaction();
$pearDBO->query("UPDATE `hosts` SET `notification_number`= 0 WHERE `notification_number`< 0");
$pearDBO->query("ALTER TABLE `hosts` MODIFY `notification_number` BIGINT(20) UNSIGNED DEFAULT NULL");
}

$errorMessage = "Impossible to update 'services' table";
if (! str_contains(strtolower($pearDBO->getColumnType('services', 'notification_number')), 'bigint')) {
$pearDBO->beginTransaction();
$pearDBO->query("UPDATE `services` SET `notification_number`= 0 WHERE `notification_number`< 0");
$pearDBO->query("ALTER TABLE `services` MODIFY `notification_number` BIGINT(20) UNSIGNED DEFAULT NULL");
}
} catch (\Exception $e) {
if ($pearDBO->inTransaction()) {
$pearDBO->rollBack();
}

$centreonLog->insertLog(
4,
$versionOfTheUpgrade . $errorMessage .
Expand Down
20 changes: 20 additions & 0 deletions www/install/php/Update-21.10.12.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* Copyright 2005 - 2022 Centreon (https://www.centreon.com/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*
*/

0 comments on commit a487b58

Please sign in to comment.