imetting/backend/sql/migrations/update_voiceprint_config.sql

23 lines
1.0 KiB
PL/PgSQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- 更新voiceprint配置
-- 将dict_type='system_config'且dict_code='voiceprint_template'的记录改为 dict_type='voiceprint' 且 dict_code='voiceprint'
-- 或者如果已经存在voiceprint类型的配置则更新它
BEGIN;
-- 1. 尝试删除旧的voiceprint配置如果存在
DELETE FROM `dict_data` WHERE `dict_type` = 'system_config' AND `dict_code` = 'voiceprint_template';
-- 2. 插入或更新新的voiceprint配置
INSERT INTO `dict_data` (
`dict_type`, `dict_code`, `parent_code`, `label_cn`, `label_en`,
`sort_order`, `extension_attr`, `is_default`, `status`
) VALUES (
'voiceprint', 'voiceprint', 'ROOT', '声纹配置', 'Voiceprint Config',
0, '{"channels": 1, "sample_rate": 16000, "template_text": "我正在进行声纹采集,这段语音将用于身份识别和验证。\n\n声纹技术能够准确识别每个人独特的声音特征。", "duration_seconds": 12}', 0, 1
)
ON DUPLICATE KEY UPDATE
`extension_attr` = VALUES(`extension_attr`),
`label_cn` = VALUES(`label_cn`);
COMMIT;