Frappe Method to remove columns that don't exist in meta (DocType) anymore

Can use below snippet in bench console to delete columns not required anymore from Database Table corresponding to a DocType.

from frappe.model.meta import trim_tables


This is super useful. Tables fill up with all sorts of junk columns during development
to start console be in the frappe-bench folder and type…

bench --site [my_site] console

1 Like