Next.js Discord

Discord Forum

Prisma Migration Borked My Vercel Postgres Database - Help!

Answered
Oriental chestnut gall wasp posted this in #help-forum
Open in Discord
Oriental chestnut gall waspOP
I was trying to write a migration for my Postgres database using Prisma. I thought I would be able to run prisma migrate dev over and over until I got my migration syntax correct. Instead, it completely borked my database and put me above my data limit, at which point the best solution seemed to be starting with a fresh database.

This is only a hobby project and I have all the data saved in .csv's to be read into the database again (I was prepared for something like this to happen), but I'd like to know how to avoid this in the future.

If I want to practice writing migrations in Prisma, how do I do that without ruining my production database?
Answered by Plott Hound
you can locally install an instance of postgres for local dev: https://www.postgresql.org/download/

this would be the best solution while you are learning are defining the schema/data structure of your app.

Alternatively many of us use Supabase for our postgres as it has a very generous free plan compared to vercel
View full answer

5 Replies

Answer
Oriental chestnut gall waspOP
Is there an option to mark it solved on mobile?
@Oriental chestnut gall wasp Is there an option to mark it solved on mobile?
Yes. Read the first message sent by the bot :meow_coffee: