SET @column_exists := (
    SELECT COUNT(*)
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE()
      AND TABLE_NAME = 'incident_status'
      AND COLUMN_NAME = 'pendingpoint'
);
SET @sql := IF(@column_exists = 0,
    'ALTER TABLE incident_status ADD COLUMN pendingpoint INT NULL AFTER incident_status',
    'SELECT ''incident_status.pendingpoint already exists'' AS message'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
