40 lines
1.4 KiB
PHP
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();
|
|
}
|
|
}
|
|
}
|