Files
thetool/db/migrations/20251118185006_add_fiber_plan_fiber.php
Daniel Spitzer b1f9e4bdcb Faserplanung
* Migrations für Kabeln/Fasern/Kabelstationen/Homes
2025-11-30 19:01:56 +01:00

71 lines
4.2 KiB
PHP

<?php
use Phinx\Migration\AbstractMigration;
final class AddFiberPlanFiber extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("FiberPlanFiber", ["signed" => true]);
$table->addColumn("cable_id", "integer", ["null" => true]);
$table->addColumn("sheet_range", "string", ['limit' => 255,"null" => true]);
$table->addColumn("cable_route", "string", ['limit' => 255,"null" => true]);
$table->addColumn("connector_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("fiber_nr_cable", "integer", ["null" => true]);
$table->addColumn("bundle_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("fiber_nr_bundle", "string", ['limit' => 255,"null" => true]);
$table->addColumn("fiber_color", "string", ['limit' => 255,"null" => true]);
$table->addColumn("fiber_color_hex", "string", ['limit' => 255,"null" => true]);
$table->addColumn("bundle_color", "string", ['limit' => 255,"null" => true]);
$table->addColumn("bundle_color_hex", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_type", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_cable_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_fiber_count", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_fiber_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_bundle_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_fiber_in_bundle", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_bundle_color", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_bundle_color_hex", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_from_location", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_to_location", "string", ['limit' => 255,"null" => true]);
$table->addColumn("branch_gis_id", "string", ['limit' => 255,"null" => true]);
$table->addColumn("address", "text", ["null" => true]);
$table->addColumn("name", "string", ['limit' => 255,"null" => true]);
$table->addColumn("home_id", "string", ['limit' => 255,"null" => true]);
$table->addColumn("location", "string", ['limit' => 255,"null" => true]);
$table->addColumn("rack_unit", "string", ['limit' => 255,"null" => true]);
$table->addColumn("termination_type", "string", ['limit' => 255,"null" => true]);
$table->addColumn("customer_cable_type", "string", ['limit' => 255,"null" => true]);
$table->addColumn("customer_cable_fiber_nr", "string", ['limit' => 255,"null" => true]);
$table->addColumn("customer_connector_type", "string", ['limit' => 255,"null" => true]);
$table->addColumn("customer_cable_spec", "string", ['limit' => 255,"null" => true]);
$table->addColumn("customer_fiber_range", "string", ['limit' => 255,"null" => true]);
$table->addColumn("splitter_location", "string", ['limit' => 255,"null" => true]);
$table->addColumn("splitter_factor", "string", ['limit' => 255,"null" => true]);
$table->addColumn("uuid_qgis_kabel", "string", ['limit' => 255,"null" => true]);
$table->addColumn("status", "string", ['limit' => 255,"null" => true]);
$table->addColumn("comment", "text", ["null" => true]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => true]);
$table->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("FiberPlanFiber")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>