Files
thetool/db/migrations/20250805145608_worker_add_password_reset.php
Daniel Spitzer f002f7b0f7 Login Passwort reset
* Passwort Reset Funktion implementiert
2025-08-05 19:14:51 +02:00

34 lines
1010 B
PHP

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