I know this was a while ago but the fix is to first make a change in your schema.prisma file. Add whatever changes you need. Then run the command you are running. It will then notice the changes you made on the file and generate the SQL needed to achieve that change. Hope this helps.
I know this was a while ago but the fix is to first make a change in your schema.prisma file. Add whatever changes you need. Then run the command you are running. It will then notice the changes you made on the file and generate the SQL needed to achieve that change. Hope this helps.
Are you trying to do an empty migration? Try using
prisma migrate dev --create-only
doc
Prisma: how do you handle migrations + custom sql
How do I use Prisma without having to wipe my database all the time?
sql - How to add an empty migration in prisma? - Stack Overflow
A better Prisma down migration flow for development
So prisma can’t handle all types of Postgres objects. Placing them as regular prisms migrations with custom sql causes an issue in where squashing migrations won’t retain the custom sql.
Currently I have two directories: one for prisma managed migrations and one for manual migrations which contain custom sql. I migrate with prisma first, then the manual migrations. No fear of losing schema changes.
How do ya’ll handle this issue?
I'm using Prisma for a large project I've been working on for the past few months, and I still don't understand the flow of it. At first I was migrating every time I made a change to my schema, and constantly getting the "All data will be lost" prompt. Since then I've learned to use `db push` while developing and then migrate when a feature is finished, but it's still constantly making me reset my database.
Right now I'm using the same db for dev and staging (because I don't want to pay for 2 different ones) but I'd imagine this would still be an issue if I had separate databases. What do I need to do to stop being forced to reset my db? Or, at least, how would I migrate my development db to mirror my production db without it being wiped?
As you can probably tell, this is my first time working with Prisma (or any ORM, in depth) so this might be a stupid question, but I can't find much online besides general tutorials. Any help would be greatly appreciated!