SET @column_exists := (
    SELECT COUNT(*)
    FROM information_schema.columns
    WHERE table_schema = DATABASE()
      AND table_name = 'tk_pool'
      AND column_name = 'enable_order_summary_cache'
);

SET @sql := IF(
    @column_exists = 0,
    'ALTER TABLE tk_pool ADD COLUMN enable_order_summary_cache TINYINT(1) NOT NULL DEFAULT 1 COMMENT ''是否记录淘宝转链订单匹配缓存''',
    'SELECT 1'
);

PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
