I uninstalled the custom app from my server but still there exists the some custom fields of app’s doctypes. How to get rid of those?
@bahaou
Those fields are still there. so, its not working for bench migrate
These are fields and still showing up after uninstall. Even though that doctype not exist in it.
I have noticed the same issue. The applications does not get removed cleanly, they leave over some annoying custom fields.
I also have the same issue with the Notification doctype. I have deleted it multiple times, but it reappears after running bench migrate
. How can I fix this?
Thanks
Shubham
Hi
You can use bench trim-tables
https://frappeframework.com/docs/user/en/bench/reference/trim-tables
I noticed that if you add custom fields using your custom app fixtures and you use the command export fixtures
, those fields get written into the database as if they were created using the frontend and the custom_fields.json file where the fields were created are cleaned out. These fields never get deleted when the custom app is uninstalled as the custom fields have been written to the db thereby localising it. the only way to get rid of the custom fields is to manually delete them from the custom fields doctype so they’re deleted from the db. I believe this is by design and not a bug.
The way around this? Never use export fixtures
to add custom fields from a custom app if you want the fields to be deleted when the custom app is uninstalled. Once you define the custom fields in the custom_fields.json file, just bench --site [site-name] migrate
and the fields will be added to the respective doctypes and so when you uninstall the custom app and migrate the fields will also be deleted.