25 lines
801 B
PHP
25 lines
801 B
PHP
<?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();
|
|
}
|
|
}
|
|
} |