-
Hi good folks, I have had this pop up a number of times but liked to formalize it a bit better. We recently made the jump from prisma 1 to prisma 2 as well Considering the Migrate API is still experimental, we had been attempting to try to model our data in a 'table-first' way, using migrations from As an example, what one of our datamodels looks like before we edited it:
What the datamodel looks like after we adjusted and made it more readable:
These schemas changed a bit in between in other factors, but I hope it can show what I mean. The original column-names from relations are rather verbose, and quite hard to read / use in the rest of the application (when a client is based on this in that sense). We are aware that we can simply rename the relation fields, but what would happen when we make an edit to the database (using a new migration), is that we would lose these changes, which would introduce a buffer to our experience in editing our data model. As such, we feel like we are a bit stuck between a rock (hard-to-read introspected relations) and a hard place (an experimental API). We do love the product, so we are considering jumping in the bed with prisma migrate instead, and hope the various changes to the API won't break our application or deployment too much. Still, we would love some input from how people look at this issue. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @JMitnik 👋 This would be the best approach until |
Beta Was this translation helpful? Give feedback.
Hey @JMitnik 👋
Yes is this an issue a lot of folks are facing due to the bring your own migrations strategy for now. The best way to approach this would be using a post instrospection script as stated here so you could then after
prisma introspect
run this script so that it maps the model fields correctly without manual intervention!This would be the best approach until
prisma migrate
is stable.