Files
thetool/db/migrations/20251210120000_add_workorder_mph_permissions.php

32 lines
789 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddWorkorderMphPermissions extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("WorkerPermission");
$table->addColumn("canWorkorderMph", "enum", ["values" => 'false,true', "default" => "false", "after" => "canWorkorderMphAdmin"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("WorkerPermission")->removeColumn("canWorkorderMph")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}