31 lines
862 B
PL/PgSQL
31 lines
862 B
PL/PgSQL
BEGIN;
|
|||
|
|
|
||
|
|
ALTER TABLE content_model_config
|
||
|
|
DROP CONSTRAINT content_model_config_provider_check;
|
||
|
|
|
||
|
|
ALTER TABLE content_model_config
|
||
|
|
ADD CONSTRAINT content_model_config_provider_check CHECK (provider IN (
|
||
|
|
'ark',
|
||
|
|
'dashscope',
|
||
|
|
'deepseek',
|
||
|
|
'moonshot',
|
||
|
|
'zhipu',
|
||
|
|
'qianfan',
|
||
|
|
'hunyuan',
|
||
|
|
'minimax',
|
||
|
|
'baichuan',
|
||
|
|
'siliconflow',
|
||
|
|
'ollama',
|
||
|
|
'openai_compatible'
|
||
|
|
));
|
||
|
|
|
||
|
|
-- Classify local Ollama records created before provider-specific options were
|
||
|
|
-- available. This changes only the label/transport capability profile; the
|
||
|
|
-- encrypted credential, activation state and model identity stay untouched.
|
||
|
|
UPDATE content_model_config
|
||
|
|
SET provider = 'ollama'
|
||
|
|
WHERE provider = 'openai_compatible'
|
||
|
|
AND base_url ~* '^http://(ollama|localhost|127\.0\.0\.1)(:[0-9]+)?(/|$)';
|
||
|
|
|
||
|
|
COMMIT;
|