Files
dukang/.cursor/rules/prisma-schema.mdc
T
2026-07-12 07:50:27 +08:00

30 lines
788 B
Plaintext
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.
---
description: Prisma schema 变更需对齐 V2 手册 §五 并经表 OWNER Review
globs: server/dukang-api/prisma/**
alwaysApply: false
---
# Prisma / 数据库规则
## 事实源
V2 手册 §五(v3.1,28 表)。schema 与手册保持一致。
## 变更流程
1. 确认受影响 Module OWNER(见 `server/dukang-api/AGENTS.md` 表映射)
2. 修改 `schema.prisma`
3. `pnpm db:validate`
4. PR 需对应 OWNER + Lead Review
## 关键约定
- 无 `payments` / `user_order_item` / `redeem_tokens` 表
- 核销码仅 Redis **3 分钟**`REDEEM_TOKEN_TTL_SECONDS=180`
- 支付流水 → `log_third_party` + `user_order.pay_*`
- 业务事件 → `common_event`;埋点 → `log_user_analytics`
## preV1
不删表、不改 V2 字段语义。Seed`prisma/seed-v31.ts`