admin/sql/20260801_ai_skill.sql
zzh c8107cb565 feat: add additional-service billing, conditions, and fee lifecycle hardening
Support optional services and executable billing conditions on sell/buy prices, percent-of-value and percent-of-freight formulas, place-order/inbound payable on chargeable weight, outbound receivable freeze, channel remote areas, billing simulate, and insurance-aware claims.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 18:04:28 +08:00

27 lines
1.5 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.

-- 平台级 AI Skill 表(全局一份,系统页维护)
CREATE TABLE IF NOT EXISTS `t_ai_skill` (
`Id` INT NOT NULL AUTO_INCREMENT COMMENT '主键',
`SkillKey` VARCHAR(64) NOT NULL COMMENT '稳定键',
`Scene` VARCHAR(32) NOT NULL COMMENT '场景 pricePublish/autoTriggerFormula/receiverAddressParse/itfxPrefixScript',
`Name` VARCHAR(128) NOT NULL COMMENT '展示名',
`Description` VARCHAR(512) NULL COMMENT '简介',
`Content` LONGTEXT NOT NULL COMMENT '发给模型的正文',
`SortOrder` INT NOT NULL DEFAULT 0 COMMENT '排序',
`Enabled` TINYINT NOT NULL DEFAULT 1 COMMENT '是否启用:0-否,1-是',
`IsDeleted` TINYINT NOT NULL DEFAULT 0 COMMENT '软删除:0-否,1-是',
`ConcurrencyStamp` CHAR(36) NOT NULL DEFAULT (UUID()) COMMENT '并发戳',
`CreateUserId` INT NOT NULL DEFAULT 0 COMMENT '创建人',
`CreateTime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`UpdateUserId` INT NULL COMMENT '更新人',
`UpdateTime` DATETIME NULL COMMENT '更新时间',
PRIMARY KEY (`Id`),
UNIQUE KEY `uk_ai_skill_key` (`SkillKey`),
KEY `idx_ai_skill_scene` (`Scene`, `Enabled`, `SortOrder`)
) COMMENT='平台级 AI Skill(提示词/规范)';
-- 若表已按旧脚本建好(无 ConcurrencyStamp),执行:
-- ALTER TABLE `t_ai_skill`
-- ADD COLUMN `ConcurrencyStamp` CHAR(36) NOT NULL DEFAULT (UUID()) COMMENT '并发戳' AFTER `IsDeleted`;
-- 种子数据由应用首次调用 /ai/skill/list|get 时幂等写入(避免 LONGTEXT 转义问题)。