any recommendations on how to use prisma to backfill data? a typical scenario we have is that we add a column to a table. All the existing records need to be updated to add a value based on some logic. How can I use prisma to insert those values to the new column on existing records?
b
Ben Broich
05/26/2022, 6:49 AM
If you can't do it via SQL Query after the migration took place I guess maybe creating a seed for this purpose would work, or some kind of script that you run one time.
@Nurul@Ben Broich is there a way to invoke a seed script per migration. example: migration 1 invokes script 1, migration 2 invokes script 2 etc? If yes how do we do that?
n
Nurul
05/27/2022, 10:32 AM
I don’t think it’s possible at the moment, can’t you define conditions in your seed script to perform operations based on the migration names? Or before running the migration you would need to manually change the contents of the seed file
r
Rahul Taing
05/27/2022, 6:13 PM
yes of course we can implement that in our seed script. just trying to see what we get out of the box with prisma.