-- +goose Up
-- +goose StatementBegin

ALTER TABLE chat_qrcode_pool
  ADD COLUMN group_name VARCHAR(128) NOT NULL DEFAULT '' COMMENT '企业微信群名' AFTER image_url,
  ADD COLUMN wecom_renamed TINYINT(1) NOT NULL DEFAULT 0 COMMENT '企业微信侧已改名标记' AFTER note;

INSERT INTO system_configs (`key`, `value`, description) VALUES
('integration.paddle_ocr_token', '', 'PaddleOCR API Token，用于二维码群名自动识别'),
('integration.paddle_ocr_job_url', 'https://paddleocr.aistudio-app.com/api/v2/ocr/jobs', 'PaddleOCR 异步任务接口地址'),
('integration.paddle_ocr_model', 'PaddleOCR-VL-1.6', 'PaddleOCR 识别模型')
ON DUPLICATE KEY UPDATE
  description = VALUES(description);

-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin

ALTER TABLE chat_qrcode_pool
  DROP COLUMN wecom_renamed,
  DROP COLUMN group_name;

DELETE FROM system_configs
WHERE `key` IN (
  'integration.paddle_ocr_token',
  'integration.paddle_ocr_job_url',
  'integration.paddle_ocr_model'
);

-- +goose StatementEnd
