Files
thetool/db/migrations/20240122150833_netzgebiet_add_unit_create_oaid.php
2024-01-23 13:39:14 +01:00

32 lines
794 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class NetzgebietAddUnitCreateOaid extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("Netzgebiet");
$table->addColumn("unit_create_oaid", "integer", ["null" => false, "default" => 0, "after" => "unit_count"]);
$table->update();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$this->table("Netzgebiet")->removeColumn("unit_create_oaid")->save();
}
}
}