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

37 lines
1.4 KiB
PHP

<?php
use Phinx\Migration\AbstractMigration;
final class AddFiberPlanCableStation extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("FiberPlanCableStation", ["signed" => true]);
$table->addColumn("cable_id", "integer", ["null" => false]);
$table->addColumn("station_order", "integer", ["null" => false,'comment' => 'Reihenfolge der Station im Kabelverlauf (1, 2, 3...)']);
$table->addColumn("station_type", "enum", ['values' => ['pop', 'dispatcher'],"null" => false,'comment' => 'Typ: pop oder dispatcher']);
$table->addColumn("station_id", "integer", ["null" => false,'comment' => 'ID des Pop oder Dispatcher']);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("FiberPlanCableStation")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>