SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;

-- 备注是币商充值补单和异常处理的审计字段；已经跑过 080 的环境需要补列，新库由 080 直接创建。
SET @ddl := IF(
  (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'admin_coin_seller_recharge_orders' AND COLUMN_NAME = 'remark') = 0,
  'ALTER TABLE admin_coin_seller_recharge_orders ADD COLUMN remark TEXT NULL COMMENT ''运营备注，用于补单和异常说明'' AFTER grant_status',
  'SELECT 1'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
