getEnvironment() == "thetool") { $table = $this->table("Address"); $table->addColumn("country_id", "integer", ["null" => true, "default" => null, "after" => "country"]); $table->save(); // call country_id update script $orig_dir = getcwd(); chdir(BASEDIR."/scripts"); echo " * running \033[1;32mscripts/address-update-country_id.php\033[0m to populate Address.country_id\n"; $return = shell_exec("/usr/bin/env php ".BASEDIR."/scripts/address-update-country_id.php"); chdir($orig_dir); if($return) { die("Error while running county_id update script:\n\n\033[1;31m$return\033[0m\n\nAborting."); } echo "\033[1;31m=====================================\033[0m\n"; echo "\033[1;31m===\033[0m address-update-country_id.php \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m ist gelaufen. \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m ----------------------------- \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m \033[1;32mWenn keine Fehler:\033[0m \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m \033[1;32mBitte Spalte 'country' aus\033[0m \033[1;31m===\033[0m\n"; echo "\033[1;31m===\033[0m \033[1;32mtable 'Address' löschen!!!\033[0m \033[1;31m===\033[0m\n"; echo "\033[1;31m=====================================\033[0m\n"; // remove country //$this->table("Address")->removeColumn("country")->save(); } if($this->getEnvironment() == "addressdb") { } } public function down(): void { if($this->getEnvironment() == "thetool") { $this->table("Address")->removeColumn("country_id")->save(); } if($this->getEnvironment() == "addressdb") { } } }