Replies: 3 comments 1 reply
-
I am also struggling with this issue. Would love to see some improvements in the documentation around this area! |
Beta Was this translation helpful? Give feedback.
-
I know you can use prisma's seeding feature to inject database entries. Maybe we're supposed to put all our dev data in a seed file? If so it would be good to have the docs mention that. It might still be an issue for projects where you need to constantly be changing data during development and testing. Same for projects that involve file/image uploads since I'm not sure how you'd put those in a seed file. I've been reading through the docs, and the only other way I can see to do migrations is to change your dev script to I also tried to figure out a way to get back to a working state after using the default push behavior, without deleting all the dev data. You can use:
To create the missing migration. Then run After that the database should be fully up to date with the migrations, and you can switch over to using the Not sure if that's how it's intended to be done, but those are my workarounds so far. |
Beta Was this translation helpful? Give feedback.
-
@pc-erin we recently added two Could you comment on that pull request with your feedback and opinions? |
Beta Was this translation helpful? Give feedback.
-
I was wondering what the standard way to handle migrations is meant to be.
As I recall, migrations used to be generated automatically when I made schema changes, but it seems like that's no longer the case.
Now, I use
keystone dev
but no new migrations appear. So I tried usingkeystone prisma migrate dev
, but that says that because the DB has drifted, it needs to reset the entire thing, which will delete all my dev data.Am I supposed to reset the database on every migration, or is there some other way this is meant to work? Can I just create a migration that would bring the previous migration into line with the current schema/DB state, but not apply it locally?
It seems like there should be a simple way to do this.
Beta Was this translation helpful? Give feedback.
All reactions