PrismaClientKnownRequestError: The table `public.User` does not exist in the current database.
Hi, Wasp team.
I deployed my project to Fly.io though the CLI commands, and added secrets required for the app to run. I try to signup a user within the app and end up getting the following error:
PrismaClientKnownRequestError:Invalid `prisma.user.count()` invocation:The table `public.User` does not exist in the current database.at Ln.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7753) at Ln.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7061) at Ln.request (/app/node_modules/@prisma/client/runtime/library.js:121:6745) at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9633) at async onBeforeSignup (/app/src/auth/hooks.ts:26:17) at async signup (/app/.wasp/build/server/src/auth/providers/username/signup.ts:37:7) { code: 'P2021', clientVersion: '5.19.1', meta: { modelName: 'User', table: 'public.User' } }🐝 This error can happen if you did't run the database migrations.
PrismaClientKnownRequestError:Invalid `prisma.user.count()` invocation:The table `public.User` does not exist in the current database.at Ln.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7753) at Ln.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:121:7061) at Ln.request (/app/node_modules/@prisma/client/runtime/library.js:121:6745) at async l (/app/node_modules/@prisma/client/runtime/library.js:130:9633) at async onBeforeSignup (/app/src/auth/hooks.ts:26:17) at async signup (/app/.wasp/build/server/src/auth/providers/username/signup.ts:37:7) { code: 'P2021', clientVersion: '5.19.1', meta: { modelName: 'User', table: 'public.User' } }🐝 This error can happen if you did't run the database migrations.
I have run multiple
wasp clean
wasp clean
s and several redeployments. However, the issue still persist.
I also tried to ssh to the server and manually deploy the schema using:
npx prisma migrate deploy
npx prisma migrate deploy
However, this gives me the following Error:
Error: Could not find Prisma Schema that is required for this command.You can either provide it with `--schema` argument, set it as `prisma.schema` in your package.json or put it into the default location.Checked following paths:schema.prisma: file not foundprisma/schema.prisma: file not foundprisma/schema: directory not foundSee also https://pris.ly/d/prisma-schema-location
Error: Could not find Prisma Schema that is required for this command.You can either provide it with `--schema` argument, set it as `prisma.schema` in your package.json or put it into the default location.Checked following paths:schema.prisma: file not foundprisma/schema.prisma: file not foundprisma/schema: directory not foundSee also https://pris.ly/d/prisma-schema-location
The schema.prisma does not seem to be even pushed to the deployment container. I only followed the standard CLI commands for deployment.