if($mysql->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ticket' AND COLUMN_NAME = 'priority' AND TABLE_SCHEMA = '$mysql_db'")->num_rows!=0){
$mysql->query("ALTER TABLE ticket DROP priority");
}else{
print'priority column already deleted'.PHP_EOL;
}
// Update user table
print'[2/3] Updating user table...'.PHP_EOL;
if($mysql->query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'user' AND COLUMN_NAME = 'supervisedrelation_id' AND TABLE_SCHEMA = '$mysql_db'")->num_rows==0){
$mysql->query("ALTER TABLE user ADD supervisedrelation_id int(11) UNSIGNED DEFAULT NULL");