Files
thetool/db/migrations/20250314130000_woker_add_active.php
2025-05-09 13:28:42 +02:00

25 lines
724 B
PHP

<?php declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WokerAddActive extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$workerTable = $this->table("Worker");
$workerTable
->addColumn("active", "integer", ['default' => 1, "after" => "id"])
->save();
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$workerTable = $this->table("Worker");
$workerTable
->removeColumn("active")
->save();
}
}
}
//SQL: ALTER TABLE Worker ADD COLUMN active INT DEFAULT 1;