getEnvironment() == "thetool") { $PreorderNotificationTable = $this->table("PreordercampaignStatusnotificationMailtemplate"); if ($PreorderNotificationTable->hasColumn("status_code")) { $PreorderNotificationTable ->changeColumn("status_code", "integer", ["null" => true]) ->update(); } if (!$PreorderNotificationTable->hasColumn("notification_type")) { $PreorderNotificationTable ->addColumn("notification_type", "enum", [ "values" => ["status", "logical"], "default" => "status", "null" => false, "after" => "status_code" ]) ->update(); } if (!$PreorderNotificationTable->hasColumn("logical_config")) { $PreorderNotificationTable ->addColumn("logical_config", "json", [ "null" => true, "after" => "notification_type" ]) ->update(); } if (!$PreorderNotificationTable->hasIndex(["notification_type"])) { $PreorderNotificationTable ->addIndex(["notification_type"], ["name" => "idx_notification_type"]) ->update(); } if (!$PreorderNotificationTable->hasIndex(["status_code"])) { $PreorderNotificationTable ->addIndex(["status_code"], ["name" => "idx_status_code"]) ->update(); } } } public function down(): void { if ($this->getEnvironment() == "thetool") { $PreorderNotificationTable = $this->table("PreordercampaignStatusnotificationMailtemplate"); if ($PreorderNotificationTable->hasIndex(["notification_type"])) { $PreorderNotificationTable ->removeIndex(["notification_type"]) ->update(); } if ($PreorderNotificationTable->hasIndex(["status_code"])) { $PreorderNotificationTable ->removeIndex(["status_code"]) ->update(); } if ($PreorderNotificationTable->hasColumn("logical_config")) { $PreorderNotificationTable ->removeColumn("logical_config") ->update(); } if ($PreorderNotificationTable->hasColumn("notification_type")) { $PreorderNotificationTable ->removeColumn("notification_type") ->update(); } if ($PreorderNotificationTable->hasColumn("status_code")) { $PreorderNotificationTable ->changeColumn("status_code", "integer", ["null" => false]) ->update(); } } } }