34 lines
1010 B
PHP
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") {
|
|
|
|
}
|
|
}
|
|
}
|