SET NAMES utf8mb4;

SET @has_phone := (
  SELECT COUNT(*)
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE()
    AND TABLE_NAME = 'business_users'
    AND COLUMN_NAME = 'phone'
);
SET @sql_add_phone := IF(
  @has_phone = 0,
  'ALTER TABLE business_users ADD COLUMN phone VARCHAR(80) DEFAULT NULL AFTER name',
  'SELECT 1'
);
PREPARE stmt_add_phone FROM @sql_add_phone;
EXECUTE stmt_add_phone;
DEALLOCATE PREPARE stmt_add_phone;
