I am trying to connect Postgres db created on vercel to Prisma in Next.js project.
I copied this variables to .env file:
enter image description here
In schema.prisma I have code from here
enter image description here
- some models
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
}
...
I am trying to run this command:
npx prisma migrate dev --name init
And recieve an error:
Error: P1001: Can’t reach database server at ...
Please make sure your database server is running at ...
.
What I am doing wrong?