Now trimming decimal gps values to not be truncated in database

This commit is contained in:
Frank Schubert
2025-01-23 15:04:52 +01:00
parent 750088adf1
commit 2fdb5d00b0
3 changed files with 66 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AdbIncreaseGpsFloatSize extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$hn = $this->table("Hausnummer");
$hn->changeColumn("gps_lat", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$hn->changeColumn("gps_long", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$hn->changeColumn("borderpoint_lat", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$hn->changeColumn("borderpoint_long", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$hn->update();
$fcp = $this->table("RimoFcp");
$fcp->changeColumn("gps_lat", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$fcp->changeColumn("gps_long", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$fcp->update();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
}
}
}