I need to add an empty migration to write a SQL query and manipulate the data manually.
There is no change in my schema and basically, I just need to apply this query to my existing data.
How to add an empty migration in prisma?
A trick I used before knowing the above solution:
Make a change on your schema and then run the command to create the migration folder, then remove the migration file's content, also remove changes from the schema file and write what ever you want!
Recommended way:
Add --create-only to your command.
prisma migrate dev --create-only --name <NAME_OF_YOUR_MIGRATION>
A trick I used before knowing the above solution:
Make a change on your schema and then run the command to create the migration folder, then remove the migration file's content, also remove changes from the schema file and write what ever you want!
© 2022 - 2025 — McMap. All rights reserved.