Files
ecom-dmb/apps/server/sql/migration/V20260919c__agent_company_llm_settings.sql
T
2026-09-18 17:34:38 +08:00

18 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 公司 Agent 模型 API 配置(OpenAI Compatible)
CREATE TABLE IF NOT EXISTS `agent_company_llm_settings` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`company_id` bigint UNSIGNED NOT NULL COMMENT '公司ID',
`base_url` varchar(500) NOT NULL COMMENT 'OpenAI Compatible Base URL',
`api_key_encrypted` varchar(2000) NOT NULL COMMENT 'API Key 密文',
`api_key_suffix` varchar(16) NOT NULL DEFAULT '' COMMENT 'Key 末几位(展示掩码)',
`model` varchar(200) NOT NULL COMMENT '默认模型名',
`extra_headers_json` json NULL COMMENT '可选额外请求头',
`create_by` bigint UNSIGNED NULL COMMENT '创建人用户ID',
`update_by` bigint UNSIGNED NULL COMMENT '更新人用户ID',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_agent_llm_company` (`company_id`),
CONSTRAINT `fk_agent_llm_company` FOREIGN KEY (`company_id`) REFERENCES `org_company` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='公司 Agent 模型 API 配置';