Files
thetool/db/migrations/20241204131737_create_rimo_fcp.php
2025-03-26 14:07:14 +01:00

45 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateRimoFcp extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("RimoFcp");
$table->addColumn("netzgebiet_id", "integer", ["null" => false]);
$table->addColumn("name", "string", ["null" => true, "default" => null, "limit" => 64]);
$table->addColumn("rimo_id", "string", ["null" => false]);
$table->addColumn("label", "string", ["null" => true, "default" => null, "limit" => 255]);
$table->addColumn("building_type", "string", ["null" => true, "default" => null, "limit" => 64]);
$table->addColumn("rimo_ex_state", "string", ["null" => true, "default" => null, "limit" => 64]);
$table->addColumn("rimo_op_state", "string", ["null" => true, "default" => null, "limit" => 64]);
$table->addColumn("gps_lat", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$table->addColumn("gps_long", "decimal", ["null" => true, "default" => null, "precision" => 17, "scale" => 14]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$this->table("RimoFcp")->drop()->save();
}
}
}