Faserplanung

* Migrationsvorbereitung für Kabelplanung
This commit is contained in:
Daniel Spitzer
2024-06-24 15:07:45 +02:00
parent 09a6651f0e
commit 9904bb9f50
3 changed files with 122 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Migration\AbstractMigration;
final class FiberPlanCable extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("FiberPlanCable", ["signed" => true]);
$table->addColumn("description", "text", ["null" => false]);
$table->addColumn("fibers", "integer", ["null" => false]);
$table->addColumn("diameter", "integer", ["null" => false]);
$table->addColumn("network_id", "integer", ["null" => true]);
$table->addColumn("lenght", "integer", ["null" => true]);
$table->addColumn("state", "integer", ["null" => true]);
$table->addColumn("responsible", "integer", ["null" => true]);
$table->addColumn("responsible_text", "text", ["null" => true]);
$table->addColumn("address_id", "integer", ["null" => true]);
$table->addColumn("comment", "text", ["null" => true]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("FiberPlanCable")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>

View File

@@ -0,0 +1,42 @@
<?php
use Phinx\Migration\AbstractMigration;
final class FiberPlanCableEndpoint extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("FiberPlanCableEndpoint", ["signed" => true]);
$table->addColumn("fiberPlanCable_id", "integer", ["null" => false]);
$table->addColumn("fiberPlanPipeEndpoint_id", "integer", ["null" => false]);
$table->addColumn("poprack_id", "integer", ["null" => true]);
$table->addColumn("poprackmodule_id", "integer", ["null" => true]);
$table->addColumn("fiberPlanDispatchersleeve_id", "integer", ["null" => true]);
$table->addColumn("startport", "integer", ["null" => false]);
$table->addColumn("endport", "integer", ["null" => false]);
$table->addColumn("dropout", "integer", ["null" => false, "default" => "0"]);
$table->addColumn("sort", "integer", ["null" => false]);
$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("FiberPlanCableEndpoint")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>

View File

@@ -0,0 +1,37 @@
<?php
use Phinx\Migration\AbstractMigration;
final class FiberPlanCablePipe extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("FiberPlanCablePipe", ["signed" => true]);
$table->addColumn("fiberPlanCable_id", "integer", ["null" => false]);
$table->addColumn("fiberPlanPipe_id", "integer", ["null" => false]);
$table->addColumn("fiberPlanPipe_sub", "integer", ["null" => false]);
$table->addColumn("sort", "integer", ["null" => false]);
$table->addColumn("direction", "integer", ["null" => false]);
$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("FiberPlanCablePipe")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>