Files
thetool/db/migrations/20240208151159_hausnummer_add_borderpoint_lat_long.php
2024-02-09 01:51:31 +01:00

40 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class HausnummerAddBorderpointLatLong extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("Hausnummer");
$table->addColumn("borderpoint_lat", "decimal",["null" => true, "default" => null, "precision" => 15, "scale" => 10, "after" => "gps_long"]);
$table->addColumn("borderpoint_long", "decimal", ["null" => true, "default" => null, "precision" => 15, "scale" => 10, "after" => "borderpoint_lat"]);
$table->addColumn("trenches", "json", ["null" => true, "default" => null, "after" => "borderpoint_long"]);
$table->addColumn("home_trench", "json", ["null" => true, "default" => null, "after" => "trenches"]);
$table->save();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("home_trench");
$table->removeColumn("home_trench");
$table->removeColumn("trenches");
$table->removeColumn("borderpoint_long");
$table->removeColumn("borderpoint_lat");
$table->save();
}
}
}