Files
cms-website/docs/adr/ADR-001-ORM选择Drizzle.md
浅念 07483b5ae2 docs: ADR 001–015 落档 + README
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-20 20:56:26 +08:00

7 lines
663 B
Markdown
Raw Permalink 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.
# ADR-001:ORM 选择 Drizzle(+ PostgreSQL 16)
- **状态**:已采纳(spec §3,阶段 0)
- **决策**:ORM 用 Drizzle,数据库 PostgreSQL 16;所有 Schema 通过迁移文件管理,关键约束(不可变触发器、NULLS NOT DISTINCT 唯一、CHECK)直接落数据库。
- **理由**:SQL 完全可控——库级 DDL(触发器/部分唯一索引)在手写迁移里可精确表达;cms 项目实战已验证该组合。备选 Prisma 被否决:复杂约束的表达要绕开生成器,失控感强。
- **权衡**:无成熟 migration 可视化工具,靠 drizzle-kit + 快照;换来的是约束即规格、无 ORM 魔法。