Fixed db migrations

This commit is contained in:
Frank Schubert
2024-12-22 15:58:19 +01:00
parent 4ea99c3690
commit aff469924e
5 changed files with 5 additions and 49 deletions

View File

@@ -8,8 +8,10 @@ final class Poprackmodulepatch extends AbstractMigration
public function up(): void
{
if($this->getEnvironment() == "thetool") {
// on error make poprackmodule.id signed
$poprackmodulepatch = $this->table("Poprackmodulepatch", ['signed' => true]);
$poprackmodulepatch->addColumn("poprackmodule_id", "integer", ["null" => false]);
$poprackmodulepatch->addColumn("poprackmodule_id", "integer", ["null" => false, "signed" => false])->addIndex("poprackmodule_id");
$poprackmodulepatch->addColumn("port", "integer", ["null" => false])->addIndex(['port']);
$poprackmodulepatch->addColumn("fiberPlanCable_id", "integer", ["null" => true, "default" => null])->addIndex(['fiberPlanCable_id']);
$poprackmodulepatch->addColumn("destination", "integer", ["null" => true, "default" => null, "comment" => "1:startpoint/2:endpoint"]);
@@ -19,7 +21,7 @@ final class Poprackmodulepatch extends AbstractMigration
$poprackmodulepatch->addColumn("edit", "integer", ["null" => false]);
$poprackmodulepatch->save();
$poprackmodulepatch = $this->table("Poprackmodulepatch");
$poprackmodulepatch->addForeignKey('poprackmodule_id', 'Poprackmodule', ['id'],['delete'=> 'CASCADE', 'update'=> 'RESTRICT','constraint' => 'poprackmodule_id']);
$poprackmodulepatch->addForeignKey('poprackmodule_id', 'Poprackmodule', 'id',['delete'=> 'CASCADE', 'update'=> 'RESTRICT','constraint' => 'poprackmodule_id']);
$poprackmodulepatch->save();
}

View File

@@ -17,11 +17,6 @@ final class ContractAddResellerId extends AbstractMigration
$table->update();
$table = $this->table("Contractqueue");
$table->addColumn("approved_credit", "integer", ["null" => false, "default" => 0, "after" => "approved"]);
$table->addColumn("crediting_partner_id", "integer", ["null" => true, "default" => null, "after" => "orderproduct_id"]);
$table->addColumn("crediting_partner_rate", "decimal", ["null" => true, "default" => null, "precision" => 10, "scale" => 4, "after" => "crediting_partner_id"]);
$table->addColumn("reseller_id", "integer", ["null" => true, "default" => null, "after" => "crediting_partner_rate"]);
$table->addColumn("reseller_rate", "decimal", ["null" => true, "default" => null, "precision" => 10, "scale" => 4, "after" => "reseller_id"]);
$table->addIndex("order_id");
$table->addIndex("orderproduct_id");
$table->update();
@@ -38,10 +33,6 @@ final class ContractAddResellerId extends AbstractMigration
$table = $this->table("Contractqueue");
$table->removeIndex("orderproduct_id");
$table->removeIndex("order_id");
$table->removeColumn("reseller_rate");
$table->removeColumn("reseller_id");
$table->removeColumn("crediting_partner_rate");
$table->removeColumn("crediting_partner_id");
$table->update();
$table = $this->table("Contract");

View File

@@ -20,10 +20,6 @@ final class ProductOrderContractAddContractTerm extends AbstractMigration
$table->addColumn("contract_term", "integer", ["null" => false, "default" => 12, "after" => "billing_period"]);
$table->update();
$table = $this->table("Contractqueue");
$table->addColumn("contract_term", "integer", ["null" => false, "default" => 12, "after" => "billing_period"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
@@ -34,7 +30,6 @@ final class ProductOrderContractAddContractTerm extends AbstractMigration
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Contractqueue")->removeColumn("contract_term")->update();
$this->table("Contract")->removeColumn("contract_term")->update();
$this->table("OrderProduct")->removeColumn("contract_term")->update();
$this->table("Product")->removeColumn("contract_term")->update();

View File

@@ -1786,38 +1786,6 @@ INSERT INTO `Terminationstatus` VALUES (1,10,'created',1,1,1626988046,1626988046
/*!40000 ALTER TABLE `Terminationstatus` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `Voicenumberblock`
--
DROP TABLE IF EXISTS `Voicenumberblock`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `Voicenumberblock` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`countrycode` int NOT NULL,
`areacode` int NOT NULL,
`first` int NOT NULL,
`last` int NOT NULL,
`number_prepend_zero` tinyint NOT NULL COMMENT 'is 1 if number part starts with zero (i.e. 43 123 0123456)',
`comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`create_by` int NOT NULL,
`create` int NOT NULL,
`edit_by` int NOT NULL,
`edit` int NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Voicenumberblock`
--
LOCK TABLES `Voicenumberblock` WRITE;
/*!40000 ALTER TABLE `Voicenumberblock` DISABLE KEYS */;
/*!40000 ALTER TABLE `Voicenumberblock` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `Worker`

View File

@@ -29,7 +29,7 @@ foreach(AddressModel::getAll() as $address) {
$c = strtolower(trim($address->country));
if(!$c || $c == "österreich" || $c == "Österreich" || $c == "Österreic" || $c == "Österreicch" || $c == "Österrreich" || $c == "at" || $c == "a") {
if(!$c || $c == "österreich" || $c == "Österreich" || $c == "Österreic" || $c == "Österreicch" || $c == "Österrreich" || $c == "at" || $c == "a" || $c == "ö") {
$country = $austria;
}