Files
thetool/db/migrations/20241128191804_address_add_gps_and_laea.php
Frank Schubert 33d7a4e5f1 WIP RTR Reporting
2024-12-06 13:45:20 +01:00

38 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddressAddGpsAndLaea extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Address");
$table->addColumn("gps_lat", "decimal", ["null" => true, "default" => null, "precision" => 15, "scale" => 10, "after" => "country_id"]);
$table->addColumn("gps_long", "decimal", ["null" => true, "default" => null, "precision" => 15, "scale" => 10, "after" => "gps_lat"]);
$table->addColumn("laea", "string", ["null" => true, "default" => null, "limit" => 64, "after" => "gps_long"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Address")
->removeColumn("laea")
->removeColumn("gps_long")
->removeColumn("gps_lat")
->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}