Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/it-novum/openITCOCKPIT
Browse files Browse the repository at this point in the history
… into development
  • Loading branch information
nook24 committed Jan 5, 2023
2 parents 644ea28 + edd0f53 commit a93eaaa
Show file tree
Hide file tree
Showing 36 changed files with 265 additions and 183 deletions.
5 changes: 5 additions & 0 deletions SETUP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if ! [ $(id -u) = 0 ]; then
exit 1
fi

# Enable debug mode so that CakePHP will create missing folders
# https://github.com/it-novum/openITCOCKPIT/issues/1446
# https://github.com/cakephp/migrations/issues/565
export OITC_DEBUG=1

APPDIR="/opt/openitc/frontend"

INIFILE=/opt/openitc/etc/mysql/mysql.cnf
Expand Down
5 changes: 5 additions & 0 deletions UPDATE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if [[ $1 == "--help" ]]; then
exit 0
fi

# Enable debug mode so that CakePHP will create missing folders
# https://github.com/it-novum/openITCOCKPIT/issues/1446
# https://github.com/cakephp/migrations/issues/565
export OITC_DEBUG=1

APPDIR="/opt/openitc/frontend"
INIFILE=/opt/openitc/etc/mysql/mysql.cnf
DUMPINIFILE=/opt/openitc/etc/mysql/dump.cnf
Expand Down
5 changes: 5 additions & 0 deletions bin/scripts/UPGRADE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ if ! [ $(id -u) = 0 ]; then
exit 1
fi

# Enable debug mode so that CakePHP will create missing folders
# https://github.com/it-novum/openITCOCKPIT/issues/1446
# https://github.com/cakephp/migrations/issues/565
export OITC_DEBUG=1

# Stop phpnsta-client after upgrading from V3 to V4
if systemctl is-active phpnsta.service; then
systemctl stop phpnsta.service
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20200129142142_Initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Initial extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
* @return void
*/
public function up() {
public function up(): void {
if (!$this->hasTable('acos')) {
$this->table('acos')
->addColumn('id', 'integer', [
Expand Down Expand Up @@ -5120,7 +5120,7 @@ public function up() {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
* @return void
*/
public function down() {
public function down(): void {
$this->table('acos')->drop()->save();
$this->table('apikeys')->drop()->save();
$this->table('aros')->drop()->save();
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20200129144945_VersionFour.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class VersionFour extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
* @return void
*/
public function up() {
public function up(): void {
$this->table('deleted_hosts')
->changeColumn('name', 'string', [
'default' => null,
Expand Down Expand Up @@ -364,7 +364,7 @@ public function up() {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
* @return void
*/
public function down() {
public function down(): void {

$this->table('automaps')
->removeColumn('use_paginator')
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20200211151417_Agentconnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Agentconnector extends AbstractMigration {

public function up() {
public function up(): void {
if (!$this->hasTable('agentconnector')) {
$this->table('agentconnector')
->addColumn('hostuuid', 'string', [
Expand Down Expand Up @@ -76,7 +76,7 @@ public function up() {
}
}

public function down() {
public function down(): void {
if ($this->hasTable('agentconnector')) {
$this->table('agentconnector')->drop()->save();
}
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20200515090906_UpdateAgentshostscache.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class UpdateAgentshostscache extends AbstractMigration {

public function up() {
public function up(): void {
$this->table('agenthostscache')
->changeColumn('checkdata', 'text', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::TEXT_MEDIUM])
->update();
Expand All @@ -27,7 +27,7 @@ public function up() {
->update();
}

public function down() {
public function down(): void {
$this->table('agenthostscache')
->changeColumn('checkdata', 'text', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::TEXT_REGULAR])
->update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class AddModuleToConfigurationQueue extends AbstractMigration {

public function up() {
public function up(): void {
$this->table('configuration_queue')
->addColumn('module', 'string', [
'default' => null,
Expand All @@ -25,7 +25,7 @@ public function up() {
->update();
}

public function down() {
public function down(): void {
$this->table('configuration_queue')
->removeColumn('module')
->update();
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20200908122726_MysqlWizardMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MysqlWizardMigration extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$this->table('wizard_assignments')
->addColumn('id', 'integer', [
'autoIncrement' => true,
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20200914091330_OAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class OAuth extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$table = $this->table('users');
$table
->addColumn('is_oauth', 'boolean', [
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20201013093523_DisableAgentProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DisableAgentProxy extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$this->table('agentconfigs')
->changeColumn('proxy', 'boolean', [
'default' => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AddPasswordToCustomMacros extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$table = $this->table('customvariables');
$table
->addColumn('password', 'integer', [
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20210127115645_GolangAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class GolangAgent extends AbstractMigration {

public function up() {
public function up(): void {
$this->table('agentconfigs')
->addColumn('use_autossl', 'boolean', [
'default' => '1',
Expand Down Expand Up @@ -43,7 +43,7 @@ public function up() {
->update();
}

public function down() {
public function down(): void {
$this->table('agentconfigs')
->removeColumn('use_autossl')
->removeColumn('autossl_successful')
Expand Down
4 changes: 2 additions & 2 deletions config/Migrations/20210209130254_GolangAgentPush.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GolangAgentPush extends AbstractMigration {
*/
public $autoId = false;

public function up() {
public function up(): void {
if ($this->hasTable('agentconnector')) {
$this->table('agentconnector')->drop()->save();
}
Expand Down Expand Up @@ -113,7 +113,7 @@ public function up() {

}

public function down() {
public function down(): void {
if ($this->hasTable('push_agents')) {
$this->table('push_agents')->drop()->save();
}
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20210305074746_GolangPushAgentIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GolangPushAgentIndex extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$this->table('push_agents')
->addIndex(
[
Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20210511114343_ChangeMaxLimitForJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ChangeMaxLimitForJson extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$this->table('widgets')
->changeColumn('json_data', 'text', [
'default' => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UpdateNotificationsEnabled extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function up() {
public function up(): void {
$this->execute('UPDATE hosttemplates SET hosttemplates.notifications_enabled = 1');
$this->execute('UPDATE servicetemplates SET servicetemplates.notifications_enabled = 1');
}
Expand Down
3 changes: 1 addition & 2 deletions config/Migrations/20210915122539_MessageOfTheDay.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MessageOfTheDay extends AbstractMigration {
*/
public $autoId = false;

public function change() {
public function change(): void {
if (!$this->hasTable('messages_otd')) {
$this->table('messages_otd')
->addColumn('id', 'integer', [
Expand Down Expand Up @@ -82,7 +82,6 @@ public function change() {
'limit' => null,
'null' => false,
])

->addIndex(['date'], ['unique' => true])
->create();

Expand Down
2 changes: 1 addition & 1 deletion config/Migrations/20211228081247_Ldapgroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Ldapgroups extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {

$this->table('ldapgroups')
->addColumn('id', 'integer', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LdapgroupsToUsergroups extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {
$this->table('ldapgroups_to_usergroups')
->addColumn('id', 'integer', [
'autoIncrement' => true,
Expand Down
33 changes: 15 additions & 18 deletions config/Migrations/20220511053118_FilterBookmarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

use Migrations\AbstractMigration;

class FilterBookmarks extends AbstractMigration
{
class FilterBookmarks extends AbstractMigration {
public $autoId = false;

/**
Expand All @@ -14,8 +13,7 @@ class FilterBookmarks extends AbstractMigration
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change()
{
public function change(): void {
$this->table('filter_bookmarks')
->addColumn('id', 'integer', [
'autoIncrement' => true,
Expand All @@ -30,36 +28,35 @@ public function change()
'null' => false,
])
->addColumn('plugin', 'string', [
'default' => null,
'null' => true,
'default' => null,
'null' => true,
])
->addColumn('controller', 'string', [
'default' => null,
'null' => false,
'default' => null,
'null' => false,
])
->addColumn('action', 'string', [
'default' => null,
'null' => false,
'default' => null,
'null' => false,
])
->addColumn('name', 'string', [
'default' => null,
'null' => false,
'default' => null,
'null' => false,
])
->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
'default' => null,
'limit' => 11,
'null' => false,
])
->addColumn('filter', 'text', [
'default' => null,
'null' => false,
'default' => null,
'null' => false,
])
->addColumn('favorite', 'boolean', [
'default' => '0',
'limit' => 1,
'null' => true,
])

->addIndex(
[
'uuid',
Expand Down
2 changes: 1 addition & 1 deletion config/Seeds/InstallSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class InstallSeed extends AbstractSeed {
* @return void
* @throws Exception
*/
public function run() {
public function run():void {
// !!! IMPORTANT !!!
// Make sure to keep the right order
// Same as in DumpCommand
Expand Down
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

if (!defined('OPENITCOCKPIT_VERSION')) {
define('OPENITCOCKPIT_VERSION', '4.5.4');
define('OPENITCOCKPIT_VERSION', '4.5.5');
}

return [];
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Initial extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
* @return void
*/
public function up() {
public function up(): void {
if (!$this->hasTable('grafana_configurations')) {
$this->table('grafana_configurations')
->addColumn('id', 'integer', [
Expand Down Expand Up @@ -290,7 +290,7 @@ public function up() {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
* @return void
*/
public function down() {
public function down(): void {
$this->table('grafana_configurations')->drop()->save();
$this->table('grafana_dashboards')->drop()->save();
$this->table('grafana_userdashboard_metrics')->drop()->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Colors extends AbstractMigration {
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
* @return void
*/
public function change() {
public function change(): void {

$this->table('grafana_userdashboard_metrics')
->addColumn('color', 'string', [
Expand Down
2 changes: 1 addition & 1 deletion plugins/GrafanaModule/config/Seeds/InstallSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class InstallSeed extends AbstractSeed {
*
* @return void
*/
public function run() {
public function run(): void {
//Cronjobs
$table = $this->table('cronjobs');

Expand Down
Loading

0 comments on commit a93eaaa

Please sign in to comment.