rwadurian/backend/services/identity-service/prisma
hailin 9b9427d6a8 fix(identity-service): 修复 seed 脚本会清除所有用户数据的严重 bug
问题:每次部署 identity-service 时,seed 脚本会执行 deleteMany() 删除所有用户数据
修复:
- 检查现有用户数量,如果 > 5 则跳过 seed(保护生产数据)
- 移除所有 deleteMany() 调用
- 使用 upsert 确保系统账户存在而不是先删后建
- 管理员账户只在不存在时创建

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 03:28:59 -08:00
..
migrations/20241204000000_init refactor: 清理 migration 和 seed 数据重复定义 2025-12-21 00:43:28 -08:00
schema.prisma feat(identity-service): 添加管理员登录功能 2025-12-19 05:17:50 -08:00
seed.ts fix(identity-service): 修复 seed 脚本会清除所有用户数据的严重 bug 2025-12-22 03:28:59 -08:00