Now trimming decimal gps values to not be truncated in database
This commit is contained in:
39
db/migrations/20250123134356_adb_increase_gps_float_size.php
Normal file
39
db/migrations/20250123134356_adb_increase_gps_float_size.php
Normal 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") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user