2801e4f158
packages/db-cn:@photo/db-cn(prisma 5.22,api/worker 共享 client)+ schema(users/sessions/audit_logs,DateTime(6)、cuid、账号唯一)。 迁移 SQL 手工改写表级 collation 为 utf8mb4_0900_bin——Prisma 生成的 MySQL DDL 固定 utf8mb4_unicode_ci 会覆盖库级 bin collation,账号/token 大小写 敏感语义依赖它(后续迁移需同样复核)。services/api:@Global PrismaModule (PrismaService 封装 $connect/$disconnect,池上限仍由 DATABASE_URL_CN ?connection_limit=10 承担);reset.ts 落地 FK 包裹式 TRUNCATE;e2e 语义复核 4 例(UTC 往返/大小写敏感/audit Json+actor/ session FK Restrict P2003)。pnpm 10 未拦截 prisma engines(平台包内置), 无需 onlyBuiltDependencies。 Co-Authored-By: Claude Code <noreply@anthropic.com>
33 lines
801 B
JSON
33 lines
801 B
JSON
{
|
|
"name": "@photo/db-cn",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "CN Prisma schema + shared client (api 与 worker 共用;MySQL 8.4 utf8mb4_0900_bin,迁移经根 db:* 脚本注入 .env)",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"scripts": {
|
|
"generate": "prisma generate",
|
|
"migrate": "prisma migrate dev",
|
|
"build": "tsc -p tsconfig.json",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint ."
|
|
},
|
|
"dependencies": {
|
|
"@prisma/client": "^5.22.0"
|
|
},
|
|
"devDependencies": {
|
|
"prisma": "^5.22.0",
|
|
"typescript": "^5.6.0"
|
|
},
|
|
"prisma": {
|
|
"schema": "prisma/schema.prisma"
|
|
}
|
|
}
|