getEnvironment() == "thetool") { $table = $this->table("WorkerPermission"); $table->addColumn("canVoiceplan", "enum", ["values" => 'false,true', "default" => "false", "after" => "canVoipnumbering"]); $table->update(); // set canVoiceplan true where canVoipnumbering is true $builder = $this->getQueryBuilder(); $q = $builder->select("*")->from("WorkerPermission")->where(["canVoipnumbering" => "true"])->execute(); while($perm = $q->fetch('assoc')) { $id = $perm["id"]; $this->query("UPDATE WorkerPermission SET canVoiceplan='true' WHERE id=$id"); } } if($this->getEnvironment() == "addressdb") { } } public function down(): void { if($this->getEnvironment() == "thetool") { $table = $this->table("WorkerPermission"); $table->removeColumn("canVoiceplan"); $table->update(); } if($this->getEnvironment() == "addressdb") { } } }