Skip to content

Datamigration without loss #2193

Answered by ryands17
jkottapa asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Jayanth1991
Currently prisma migrate doesn't support directly converting scalar fields to a list without data loss.
For that, you would have to run your migrations in the following manner.

  • You would have to create a new array field first
  • seed the converted data to the newly created field
  • delete the non-required scalar field after all the data is seeded

This is currently the approach that you can follow to safely migrate from 1-n to m-n relations.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jharrell
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants