I keep getting this error. When I run `npx prisma ...
# orm-help
m
I keep getting this error. When I run
npx prisma db push
my shema changes make it into the db. But if I want to run then
npx prisma migrate dev --name whatevername
I get the following error...
r
@manuel 👋 Are you using a hosted database like Heroku?
m
hey! No I am using a local docker container to run it.
r
Does your database user have permissions to create a temporary database (also known as shadow database)? Prisma uses it to perform migrations and it seems it cannot do this.
m
Yeah it does create a shadow database. And I think the problem is that the shadow is not up2date
When I deploy I get the following error:
Species is an enum where I deleted the
undefined
option...
in the database their are not Species fields with undefined...
r
I also see that you are running
prisma migrate dev
in a non-interactive environment?
m
what is a non-interactive environment?
ah a docker container eg
r
I don’t think the main issue is the enum part as that’s just a warning. The main error is
migrate dev
cannot run in a non-interactive environment and there’s a request for the same here.
A workaround would be running
migrate dev
outside the docker container.
m
but it already worked with this setup?
btw what's the best way to get rid of all the migrations? like I want to setup a new database without the migrations?
r
Just delete the
prisma_migrations
folder in the database and delete local migration files.
but it already worked with this setup?
The screenshot you’ve added above is throwing this error so I’m surprised it worked before 😄
m
So if I want to stash the migrations I just need to delete the
_prisma_migrations
table in the database and delete the local migration files? What will prisma then do if I reset the db?
r
Nothing, you can just run a brand new migration and if there’s no problem with the data, the migration will run successfully.
m
Thanks!
💯 1