Error attempting to `yarn prisma db seed`
See original GitHub issueHi @AlphaNecron , I’m encountering an error when attempting this (docker-compose). Any ideas?
/void # export DATABASE_URL=postgres://postgres:<password>@postgres/postgres
/void # yarn prisma db seed
yarn run v1.22.15
$ /void/node_modules/.bin/prisma db seed
Running seed command `ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts` ...
PrismaClientKnownRequestError:
Invalid `prisma.user.aggregate()` invocation:
The table `public.User` does not exist in the current database.
at cb (/void/node_modules/@prisma/client/runtime/index.js:38537:17)
at async main (/void/prisma/seed.ts:8:17) {
code: 'P2021',
clientVersion: '3.3.0',
meta: { table: 'public.User' }
}
An error occured while running the seed command:
Error: Command failed with exit code 1: ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts
I’ve also tried npx...
with the same result.
To further elaborate: postgres container is running. I see the following errors in the container:
2022-02-15 15:14:17.132 UTC [1019] ERROR: relation "public.User" does not exist at character 56
2022-02-15 15:19:43.828 UTC [1297] STATEMENT: SELECT COUNT(*) FROM (SELECT "public"."User"."id" FROM "public"."User" WHERE 1=1 OFFSET $1) AS "sub"
2022-02-15 15:14:17.132 UTC [1019] STATEMENT: SELECT COUNT(*) FROM (SELECT "public"."User"."id" FROM "public"."User" WHERE 1=1 OFFSET $1) AS "sub"
2022-02-15 15:19:43.828 UTC [1297] ERROR: relation "public.User" does not exist at character 56
Thank you,
_Originally posted by @tmeuze in https://github.com/AlphaNecron/Void/issues/16#issuecomment-1040408758_
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
prisma db seed doesn't correctly support "type": "module" #7053
Problem. When you enable module resolution with "type": "module" on your projet the prisma db seed command fail due to ts-node resolution.
Read more >prisma db seed & typescript problem with import and type ...
Try and double-check your seed command in the prisma section of your package.json, it should look like the one in the repo of...
Read more >Seeding your database - Prisma
This guide describes how to seed your database using Prisma Client and Prisma's integrated seeding functionality. Seeding allows you to consistently ...
Read more >How to seed a database with Prisma and Next.js - PlanetScale
Go ahead and add a try/catch/finally block inside of your function to handle errors and disconnect from your database after the seeding has ......
Read more >Running npx prisma db seed after deployment - How To - Fly.io
Running seed command node --require esbuild-register prisma/seed.ts … node:internal/modules/cjs/loader:936 throw err; ^. Error: Cannot find ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No need, normally it does automatically for you.
docker rmi postgres -f
v0
todev
branch. (By editingdocker-compose.yml
)