Files
thetool/db/migrations/20250225151428_add_preorderbilling_permissions.php
2025-02-25 20:33:47 +01:00

38 lines
1.5 KiB
PHP

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