Merge branch 'AddressDB/add-new-tool-type-field' into 'master'

added new tool type field

See merge request fronk/thetool!1392
This commit is contained in:
Luca Haid
2025-05-27 12:06:28 +00:00
9 changed files with 207 additions and 14 deletions
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AdbHausnummerAddToolType extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "addressdb") {
$Hausnummer = $this->table("Hausnummer");
$Hausnummer->addColumn("tool_building_type", "integer", ["default" => 0, "null" => false])
->addColumn("tool_building_type_override", "boolean", ["default" => 0, "null" => false]);
$Hausnummer->update();
}
}
public function down(): void
{
if($this->getEnvironment() == "addressdb") {
$Hausnummer = $this->table("Hausnummer");
if($Hausnummer->hasColumn("tool_building_type")) $Hausnummer->removeColumn("tool_building_type");
if($Hausnummer->hasColumn("tool_building_type_override")) $Hausnummer->removeColumn("tool_building_type_override");
$Hausnummer->update();
}
}
}