Closed leetomlee123 closed 3 months ago
非常感谢您提交了 issues,我们很高兴能够与您一起合作解决这个问题。我们将尽快进行审核,并会在 24 小时内回复您。在此期间,如有任何问题,请随时联系我们。再次感谢您的贡献!
npm run prisma:deploy
初始化数据库表npm run dev
初始化数据并启动就好了@leetomlee123 您好!看图片似乎是在 Vercel
之类的云平台部署的?除了容器化部署方式外,其它的部署方式都需要执行 pnpm run prisma:deploy
,否则无法初始化。容器化部署方式可以自动初始化数据库是因为我将脚本写好了,而用户自己部署或者去云平台部署,则需要自行添加 prisma 的迁移命令。希望能帮到你!
初始化数据失败,您可能需要准备干净的数据表,请联系管理员! PrismaClientKnownRequestError: Invalid
prisma.$executeRaw()
invocation: Raw query failed. Code:42P01
. Message:relation "public.User" does not exist
at In.handleRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.13.0_prisma@5.13.0/node_modules/@prisma/client/runtime/library.js:122:6854) at In.handleAndLogRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.13.0_prisma@5.13.0/node_modules/@prisma/client/runtime/library.js:122:6188) at In.request (/var/task/node_modules/.pnpm/@prisma+client@5.13.0_prisma@5.13.0/node_modules/@prisma/client/runtime/library.js:122:5896) at async l (/var/task/node_modules/.pnpm/@prisma+client@5.13.0_prisma@5.13.0/node_modules/@prisma/client/runtime/library.js:127:11167) at async /var/task/.next/server/instrumentation.js:1:387 at async Proxy._transactionWithCallback (/var/task/node_modules/.pnpm/@prisma+client@5.13.0_prisma@5.13.0/node_modules/@prisma/client/runtime/library.js:127:9534) at async Module.t (/var/task/.next/server/instrumentation.js:1:356) at async r3.prepareImpl (/var/task/node_modules/.pnpm/next@14.2.3_react-dom@18.3.1_react@18.3.1/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:41301) { code: 'P2010', clientVersion: '5.13.0', meta: { code: '42P01', message: 'relation "public.User" does not exist' } }