SET @add_user_contact_info := (
  SELECT IF(
    COUNT(*) = 0,
    'ALTER TABLE users ADD COLUMN contact_info VARCHAR(128) NOT NULL DEFAULT '''' COMMENT ''用户联系信息'' AFTER profile_bg_img',
    'SELECT 1'
  )
  FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE()
    AND TABLE_NAME = 'users'
    AND COLUMN_NAME = 'contact_info'
);

PREPARE stmt FROM @add_user_contact_info;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
