Hi there! I want to know *how is your workflow for...
# orm-help
g
Hi there! I want to know how is your workflow for backfilling data with Prisma❓ Scenario: Add a new column (not nullable and unique) for an existing table full of data. Currently I'm doing the following: • create the migration at hand (NOT using Prisma Migrate tool) • add SQL script for adding new column (without nullabe and unique constraints) • add SQL script for backfilling data • add constraints to column there are other alternatives? maybe using seeds files? I would love to use Prisma Client code to backffill my database, but I'm not sure if there is any way to do it.
s
What you could do is something like: • Create and apply a migration without constraints • Backfill your dB with the required data using Prisma Client Create and apply new migration with constraints
g
@Samrith Shankar thanks 🙌 tow questions: • where do you place the code for backfilling your dB? • how do you do to runFirstMigration-runBackfillSeeder-runSecondMigration in that order automatically? in Dev I can do it at hand but in Production I'll need it to be automated