Hi. is it possible in prefect <2.0 >to delete all...
# ask-community
v
Hi. is it possible in prefect 2.0 to delete all deployments at once? Thanks
1
a
Why would you want to do this?
You may do:
Copy code
prefect orion database reset -y
if you want to entirely delete everything and start from scratch
Otherwise, deleting deployments in such a manner would require first listing all deployments via an API call, then deleting those in a for-loop - all doable but I would be very curious why would you need that - is this for some Terraform style CI use case?
v
Because the deployments failed to run, due to a missing import. I tried to update the deployments after I have fixed my code (added the missing import), but did not work unfortunately.
a
it might be you only need to update your docker image used by your docker/lubernetes flow runner, or conda/venv in a subprocess flow runner?
v
Furthermore, I deleted the orion db with
prefect orion database reset -y
And deleted the
.prefect
folder
a
this doesn't delete the DB, it only resets everything
v
I am using a subprocess flow runner. How can I update my conda env? Simply create a new conda env?
a
yup, or even make changes to the existing one which makes things even easier
f
What happens if you just remove the deployment table in the Orion database? Will it be recreated on the next run?
a
I'm afraid your schema will be broken since the tables have FK relationships between each other - either reset the DB or don't touch it directly, only interact with your database via API/CLI/UI or Orion client - this would be my recommendation
👍 1