Vercel + Prisma + MySQL => Prisma not creating the database (no errors at deployment)
Answered
Baguette posted this in #help-forum
BaguetteOP
Hi everyone, so it's my first time deploying a NextJS app in Vercel. I correctly setup the MySQL server with a custom user + password and port is accessible from outside (I already tested from my machine).
I have setup also the environment variables correctly and set the postinstall in my package.json as "prisma generate".
The logs seems to be fine, there are no errors but when I type "show databases" there's not the "DunyEmails" database which had to be created...
I recently tried to connect to my mysql server with a VPN, using the same user, password and port and everything works correctly but Prisma is still not creating the database as I described in my schema.
My package.json:
I have setup also the environment variables correctly and set the postinstall in my package.json as "prisma generate".
The logs seems to be fine, there are no errors but when I type "show databases" there's not the "DunyEmails" database which had to be created...
I recently tried to connect to my mysql server with a VPN, using the same user, password and port and everything works correctly but Prisma is still not creating the database as I described in my schema.
My package.json:
{
"name": "dunylanding",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"postinstall": "prisma generate",
"build": "next build",
"start": "next start",
"lint": "next lint",
"email": "email dev --dir ./app/email"
},
"dependencies": {
"@prisma/client": "^5.10.2",
"@react-email/components": "0.0.15",
"next": "14.1.0",
"react": "^18",
"react-dom": "^18",
"react-email": "2.1.0",
"react-google-recaptcha-v3": "^1.10.1",
"react-hook-form": "^7.50.1",
"resend": "^3.2.0",
"sweetalert2": "^11.10.5",
"swiper": "^11.0.7",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"postcss": "^8",
"prisma": "^5.10.2",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}Answered by Baguette
my bad guys I just had to set my postinstall to "prisma generate && prisma db push"
1 Reply
BaguetteOP
my bad guys I just had to set my postinstall to "prisma generate && prisma db push"
Answer