20261103_add_tk_pool_general_link_parse_switches.sql 1020 B

12345678910111213141516171819202122232425262728293031323334
  1. -- 两个开关默认关闭,保留现有账号的短链处理方式。
  2. SET @column_exists := (
  3. SELECT COUNT(*)
  4. FROM information_schema.columns
  5. WHERE table_schema = DATABASE()
  6. AND table_name = 'tk_pool'
  7. AND column_name = 'enable_general_link_parse_pool'
  8. );
  9. SET @sql := IF(
  10. @column_exists = 0,
  11. 'ALTER TABLE tk_pool ADD COLUMN enable_general_link_parse_pool TINYINT(1) NOT NULL DEFAULT 0 COMMENT ''加入万能解析账号池''',
  12. 'SELECT 1'
  13. );
  14. PREPARE stmt FROM @sql;
  15. EXECUTE stmt;
  16. DEALLOCATE PREPARE stmt;
  17. SET @column_exists := (
  18. SELECT COUNT(*)
  19. FROM information_schema.columns
  20. WHERE table_schema = DATABASE()
  21. AND table_name = 'tk_pool'
  22. AND column_name = 'use_general_link_parse_pool'
  23. );
  24. SET @sql := IF(
  25. @column_exists = 0,
  26. 'ALTER TABLE tk_pool ADD COLUMN use_general_link_parse_pool TINYINT(1) NOT NULL DEFAULT 0 COMMENT ''使用万能解析账号池处理短链''',
  27. 'SELECT 1'
  28. );
  29. PREPARE stmt FROM @sql;
  30. EXECUTE stmt;
  31. DEALLOCATE PREPARE stmt;