Added user property to enforce 2fa or not

This commit is contained in:
Frank Schubert
2024-02-09 18:09:02 +01:00
parent c8bd553505
commit fc260c996d
5 changed files with 57 additions and 3 deletions
@@ -0,0 +1,31 @@
<?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") {
}
}
}