Files
thetool/db/migrations/20240209165524_worker_add_twofactorrequired.php
2024-02-09 18:09:02 +01:00

32 lines
795 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class WorkerAddTwofactorrequired extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Worker");
$table->addColumn("twofactorrequired", "integer", ["null" => false, "default" => 1, "after" => "twofactortimestamp"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Worker")->removeColumn("twofactorrequired")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}