npm i
npm install @prisma/client
npx prisma generate
npx prisma migrate/dev
Prisma defaults to Postgres. I suggest going to Railway.app and spinning up a db if you don't have a local instance.
DATABASE_URL="postgresql://janedoe:mypassword@localhost:5432/mydb?schema=sample"
npx prisma db seed
If you get this error:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
The solution that worked for me was to remove this:
"type": "module"
from the package.json file when seeding, but add it back once you are done.
You could also try:
node --loader ts-node/esm "prisma/seed.ts"
instead of:
npx prisma db seed
although, this doesn't work for me and I haven't spent the time to figure out why.