Prisma Migration Borked My Vercel Postgres Database - Help!
Answered
Oriental chestnut gall wasp posted this in #help-forum
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
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?
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
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
5 Replies
@Oriental chestnut gall wasp 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?
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
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
Answer
@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
Oriental chestnut gall waspOP
Noted on all accounts, thanks so much! Vercel's plan seemed generous but i was coming from Salesforce whose free plan has like 25mb of storage LOL.
@Oriental chestnut gall wasp Noted on all accounts, thanks so much! Vercel's plan seemed generous but i was coming from Salesforce whose free plan has like 25mb of storage LOL.
Plott Hound
Glad it helped. Could you mark this as solved?
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 
