Files
thetool/db/migrations/20240119124212_add_can_statistics_permission.php

32 lines
809 B
PHP

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