Files
thetool/db/migrations/20260119170000_add_metadata_to_workorder.php
2026-01-20 13:27:35 +01:00

31 lines
739 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddMetadataToWorkorder extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("Workorder");
$table
->addColumn("metadata", "json", [
'null' => true,
'default' => null,
'after' => 'cableType'
])
->update();
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("Workorder")
->removeColumn("metadata")
->save();
}
}
}