Files
thetool/db/migrations/20250611112000_construction_consent_add_prioritize.php
2025-06-11 12:56:09 +02:00

29 lines
953 B
PHP

<?php
declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class ConstructionConsentAddPrioritize extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$ConstructionConsentTable = $this->table("ConstructionConsent");
if (!$ConstructionConsentTable->hasColumn("prioritize")) {
$ConstructionConsentTable
->addColumn("prioritize", "tinyinteger", ["default" => 0])
->update();
}
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$ConstructionConsentTable = $this->table("ConstructionConsent");
if ($ConstructionConsentTable->hasColumn("prioritize")) {
$ConstructionConsentTable
->removeColumn("prioritize")
->update();
}
}
}
}