Null constraint violation on the fields: (xxxx)
Invalid `this.dbService.db.people.create()` invocation in
/Users/qins/Documents/now/my__/staff/server/src/controller/people/add.ts:37:34
34 const dto = 参数补全(req);
35 console.log(dto);
36
→ 37 await this.dbService.db.people.create(
Null constraint violation on the fields: (`rowid`)
at cb (/Users/qins/Documents/now/my__/staff/server/node_modules/@prisma/client/runtime/index.js:38683:17)
at APIController.addMany (/Users/qins/Documents/now/my__/staff/server/src/controller/people/add.ts:37:3)
at APIController._add_ (/Users/qins/Documents/now/my__/staff/server/src/controller/people/index.ts:42:14)
at Object.<anonymous> (/Users/qins/Documents/now/my__/staff/server/node_modules/.pnpm/registry.npmmirror.com+@midwayjs+koa@2.13.4_@midwayjs+decorator@2.13.2/node_modules/@midwayjs/koa/dist/framework.js:35:28)
at /Users/qins/Documents/now/my__/staff/server/src/middleware/ContentPath.ts:36:7
at /Users/qins/Documents/now/my__/staff/server/src/middleware/ApiError.ts:16:9
at xframe (/Users/qins/Documents/now/my__/staff/server/node_modules/egg-security/lib/middlewares/xframe.js:7:5)
at xssProtection (/Users/qins/Documents/now/my__/staff/server/node_modules/egg-security/lib/middlewares/xssProtection.js:7:5)
at nosniff (/Users/qins/Documents/now/my__/staff/server/node_modules/egg-security/lib/middlewares/nosniff.js:8:5)
at noopen (/Users/qins/Documents/now/my__/staff/server/node_modules/egg-security/lib/middlewares/noopen.js:8:5) {
code: 'P2011',
clientVersion: '3.6.0',
meta: { constraint: [ 'rowid' ] }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
把数据库删了,重新生成。
这个坑,属实坑。