SET @column_exists := (
  SELECT COUNT(*)
  FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE()
    AND TABLE_NAME = 'lingxian_provider_config'
    AND COLUMN_NAME = 'test_room_id'
);

SET @ddl := IF(
  @column_exists = 0,
  'ALTER TABLE lingxian_provider_config ADD COLUMN test_room_id VARCHAR(64) DEFAULT NULL AFTER test_token',
  'SELECT 1'
);

PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
