Files
thetool/db/migrations/20231214141719_worker_permission_add_employee.php

36 lines
1015 B
PHP

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