1
0
Files
nex/openspec/changes/unified-model-id/specs/database-migration/spec.md

14 lines
673 B
Markdown
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.
## MODIFIED Requirements
### Requirement: models 表 schema 变更
系统 SHALL 通过迁移脚本重建 models 表结构(服务未上线,无需考虑数据迁移)。
#### Scenario: 迁移后 models 表结构
- **WHEN** 执行迁移
- **THEN** SHALL 先 DROP 已有的 models 表(无旧数据)
- **THEN** SHALL CREATE 新的 models 表包含字段idTEXT PRIMARY KEY、provider_idTEXT NOT NULL、model_nameTEXT NOT NULL、enabledINTEGER DEFAULT 1、created_atDATETIME
- **THEN** SHALL 存在 UNIQUE(provider_id, model_name) 约束
- **THEN** SHALL 存在 FOREIGN KEY (provider_id) REFERENCES providers(id) ON DELETE CASCADE