Hey @redsuperbat 👋
You cannot directly create schema.prisma from a dump. You would need to connect to an existing database that has your data or import the dump that you have back in the DB.
Then, to add your tables to a schema.prisma file from your database is easy by using Introspection
As you're using MySQL, you would need to follow this tutorial to setup Prisma with an existing database.
Let me know if it works :)
How to init migration with existing database
How do I use Prisma without having to wipe my database all the time?
Problem with model and existing db
Is it impossible to add new models to Prisma schema without dropping existing tables?
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!
Basically title. I have an existing Prisma schema with tables, I’d like to add a new table and migrate it without dropping existing tables.