added zabbix sync and view for Device

This commit is contained in:
Luca Haid
2024-11-05 20:42:16 +01:00
parent bea341f869
commit eb9a1a3995
6 changed files with 118 additions and 63 deletions
@@ -0,0 +1,25 @@
<?php /** @noinspection ALL */
declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class DeviceAddZabbixStatus extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$Device = $this->table("Device");
$Device->addColumn('zabbix_online', 'integer', ['null' => false, 'default' => 0]);
$Device->addColumn('zabbix_host_id', 'integer', ['null' => true]);
$Device->update();
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$Device = $this->table("Device");
$Device->removeColumn('zabbix_online');
$Device->removeColumn('zabbix_host_id');
$Device->update();
}
}
}