235_group_model_allowlist.sql 857 B

12345678910111213141516171819202122
  1. -- 235: groups.models_list_config 更名为 model_allowlist,语义从「仅影响 /v1/models 展示」
  2. -- 升级为分组级模型白名单(同时约束模型列表接口与请求准入)。数据原样保留。
  3. DO $$
  4. BEGIN
  5. IF EXISTS (
  6. SELECT 1 FROM information_schema.columns
  7. WHERE table_schema = 'public'
  8. AND table_name = 'groups'
  9. AND column_name = 'models_list_config'
  10. ) AND NOT EXISTS (
  11. SELECT 1 FROM information_schema.columns
  12. WHERE table_schema = 'public'
  13. AND table_name = 'groups'
  14. AND column_name = 'model_allowlist'
  15. ) THEN
  16. ALTER TABLE groups RENAME COLUMN models_list_config TO model_allowlist;
  17. END IF;
  18. END
  19. $$;
  20. COMMENT ON COLUMN groups.model_allowlist IS
  21. 'Group model allowlist: constrains both model listing responses and request admission';