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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user