Added Voice tables & canVoiceplan permission

This commit is contained in:
Frank Schubert
2023-10-04 17:09:58 +02:00
parent 3e7da85a41
commit be9b78065d
6 changed files with 320 additions and 3 deletions
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddVoicenumberTables extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Voicenumberblock");
$table->addColumn("name", "string", ["null" => true, "limit" => 255, "default" => null]);
$table->addColumn("countrycode", "integer", ["null" => false]);
$table->addColumn("areacode", "integer", ["null" => false]);
$table->addColumn("prefix", "string", ["null" => false, "limit" => 64]);
$table->addColumn("first", "string", ["null" => false, "limit" => 64]);
$table->addColumn("last", "string", ["null" => false, "limit" => 64]);
$table->addColumn("comment", "text", ["null" => true, "default" => null]);
$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->create();
$table = $this->table("Voicenumber");
$table->addColumn("voicenumberblock_id", "integer", ["null" => true, "default" => null]);
$table->addColumn("orderproduct_id", "integer", ["null" => true, "default" => null]);
$table->addColumn("contract_id", "integer", ["null" => true, "default" => null]);
$table->addColumn("active", "integer", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
$table->addColumn("activated_date", "integer", ["null" => true, "default" => null]);
$table->addColumn("routing", "enum", ["values" => "sipit,kolmisoft", "null" => false, "default" => "kolmisoft"]);
$table->addColumn("number", "string", ["null" => false, "limit" => 64]);
$table->addColumn("port_in_date", "integer", ["null" => true, "default" => null]);
$table->addColumn("port_out_date", "integer", ["null" => true, "default" => null]);
$table->addColumn("ported_in", "integer", ["null" => true, "default" => null]);
$table->addColumn("ported_out", "integer", ["null" => true, "default" => null]);
$table->addColumn("disabled", "integer", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
$table->addColumn("disabled_reason", "enum", ["values" => "ported_out,ported_back,reserved,legacy,damaged", "null" => true, "default" => null]);
$table->addColumn("enable_on_date", "integer", ["null" => true, "default" => null]);
$table->addColumn("comment", "text", ["null" => true, "default" => null]);
$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->create();
$table = $this->table("Voiceplan");
$table->addColumn("name", "string", ["null" => false, "limit" => 64]);
$table->addColumn("comment", "text", ["null" => true, "default" => null]);
$table->addColumn("source", "string", ["null" => true, "default" => null, "limit" => 255]);
$table->addColumn("source_id", "string", ["null" => true, "default" => null, "limit" => 255]);
$table->addColumn("increment_first", "integer", ["null" => false, "default" => 1]);
$table->addColumn("increment", "integer", ["null" => false, "default" => 1]);
$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->create();
$table = $this->table("Voiceplandestination");
$table->addColumn("voiceplan_id", "integer", ["null" => false]);
$table->addColumn("destination", "string", ["null" => false, "limit" => 64]);
$table->addColumn("prefix", "string", ["null" => false, "limit" => 64]);
$table->addColumn("purchase_price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
$table->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
$table->addColumn("increment_first", "integer", ["null" => false, "default" => 1]);
$table->addColumn("increment", "integer", ["null" => false, "default" => 1]);
$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->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Voiceplandestination")->drop();
$this->table("Voiceplan")->drop();
$this->table("Voicenumber")->drop();
$this->table("Voicenumberblock")->drop();
}
if($this->getEnvironment() == "addressdb") {
}
}
}