Merge branch 'spidev' into 'master'

Spidev

See merge request fronk/thetool!1698
This commit is contained in:
Daniel Spitzer
2025-09-02 07:28:27 +00:00
6 changed files with 131 additions and 62 deletions
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class DevicetypeAddTemperature extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Devicetype");
$table->addColumn("temp_warning", "integer", ['null' => false,'default' => '80', "after" => "power"]);
$table->addColumn("temp_critical", "integer", ['null' => false,'default' => '90', "after" => "temp_warning"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Devicetype")->removeColumn("temp_warning")->save();
$this->table("Devicetype")->removeColumn("temp_critical")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}