protected function run1($stage)
{
$arr = [];
if (!$this->hasTableColumn('logentries', 'env_id')) {
$this->console->out("Adding env_id column to logentries table...");
$arr[] = "ADD `env_id` INT DEFAULT NULL AFTER `farmid`";
$arr[] = "ADD INDEX `idx_env_id` (`env_id`)";
}
if (!$this->hasTableColumn('logentries', 'farm_role_id')) {
$this->console->out("Adding farm_role_id column to logentries table...");
$arr[] = "ADD `farm_role_id` INT DEFAULT NULL AFTER `env_id`";
}
if (!empty($arr)) {
$this->db->Execute("\n ALTER TABLE `logentries`\n " . join(', ', $arr) . "\n ");
}
}