Zeiterfassungs Billing Update/Devices Parents

This commit is contained in:
Spitzer Daniel
2024-04-16 15:14:36 +02:00
parent 9d5be184a2
commit 81251bf4dd
8 changed files with 147 additions and 1 deletions
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class DeviceAddFieldParentId extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Device", ["signed" => true]);
$table->addColumn("parent_id", "integer", ["null" => true, "after" => "devicetype_id"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Device")->removeColumn("parent_id")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}