40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AdbAddRimoStatus extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
$hn = $this->table("Hausnummer");
|
|
$hn->addColumn("rimo_ex_state", "string", ["null" => true, "default" => null, "limit" => 255, "after" => "rimo_id"]);
|
|
$hn->addColumn("rimo_op_state", "string", ["null" => true, "default" => null, "limit" => 255, "after" => "rimo_ex_state"]);
|
|
$hn->update();
|
|
|
|
$we = $this->table("Wohneinheit");
|
|
$we->addColumn("rimo_ex_state", "string", ["null" => true, "default" => null, "limit" => 255, "after" => "nutzung"]);
|
|
$we->addColumn("rimo_op_state", "string", ["null" => true, "default" => null, "limit" => 255, "after" => "rimo_ex_state"]);
|
|
$we->update();
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
$this->table("Wohneinheit")->removeColumn("rimo_status")->save();
|
|
$this->table("Hausnummer")->removeColumn("rimo_status")->save();
|
|
}
|
|
}
|
|
}
|