I would like to use the new `prisma migrate reset ...
# prisma-migrate
z
I would like to use the new
prisma migrate reset --preview-feature
as part of my testing suite to reset my db, however running it with
exec
results in:
Copy code
Error: Command failed: prisma migrate reset --preview-feature
Error: We detected that your environment is non-interactive. Running this command in not supported in this context.
Is there a way to circumvent this or run the reset programmatically?
a
Are you looking to call this programmatically or manually @Zarazas?
I see there is a GH issue where are running into issues where Prisma Migrate is erroneously thinking their environment is non-interactive and aborting: https://github.com/prisma/prisma/issues/4669
cc @tom
z
my goal is to run it in a
afterEach
in cypress and jest
so programmatically
a
Would you mind opening a feature request in the prisma/prisma repo then? The issue above is for someone who is using it interactively but Prisma Migrate is blocking it because it thinks the env is non-interactive. In your case, you want to programmatically reset the DB, so this would be a new feature request. This is something we don’t have support for yet.
I understand the value so it’s something we could look into.
In the meantime, you could also look at db push, if you don’t mind that the schema will not be created directly without using migrations. I would not like this approach a lot because you might have differences in your DB schema vs your Prisma schema, so it might not be 100% reliable, but maybe it works for you?
@Zarazas Created this GH issue to track this: https://github.com/prisma/prisma/issues/4773 No guarantees that it will be implemented, but hopefully we can think about it. :)