Stephen Jensen
01/11/2022, 12:39 AMCould not find the migration file at /app/prisma/migrations/dev/migration.sql. Please delete the directory or restore the migration file.
Is there a programmatic way to handle resolving this error? The command that I’m running to get me to this point is: npx prisma migrate dev -n dev
which connects to a postgres container running in the cluster.
I’m running this at a few sites where some of them have fresh databases so this error won’t happen there, but those with existing databases have this error. A partial solution I came up with is to run npx prisma reset -f
which is not ideal because it resets everything but has the further complication that I'd need to somehow run the migrate command and then based on the status code run this reset command which isn't the best solution.tom
01/11/2022, 7:52 AMmigration.sql
is missing). Is there anything preventing from running rm -r /app/prisma/migrations/dev
?tom
01/11/2022, 7:52 AMtom
01/11/2022, 7:57 AMmigrations
directory next to your schema.prisma
Stephen Jensen
01/11/2022, 5:45 PM/app/prisma/migrations/dev
folder when it detects it and then I run prisma migrate dev -n dev
. I get an error:
Error: Prisma Migrate has detected that the environment is non-interactive which is not supported
prisma migrate dev
is an interactive command designed to create new migrations and evolve the database in development.
Is there a better command I should be running once I delete the migrations dev folder?tom
01/13/2022, 2:13 PMStephen Jensen
01/14/2022, 3:20 PM