Importing and showing Rimo Building and Home Status

This commit is contained in:
Frank Schubert
2024-07-01 12:23:29 +02:00
parent ae298a0665
commit 350815f41a
5 changed files with 77 additions and 6 deletions
@@ -0,0 +1,39 @@
<?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();
}
}
}