31 lines
739 B
PHP
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();
|
|
}
|
|
}
|
|
}
|