seitime-frappe/frappe/patches/v14_0/delete_data_migration_tool.py
Ankush Menat 2eec621e95 chore: db.get_all -> get_all
Reduces 1 pointless function call.
Function calls are also not "super cheap" in python.
2022-08-22 11:35:14 +05:30

12 lines
399 B
Python

# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
def execute():
doctypes = frappe.get_all("DocType", {"module": "Data Migration", "custom": 0}, pluck="name")
for doctype in doctypes:
frappe.delete_doc("DocType", doctype, ignore_missing=True)
frappe.delete_doc("Module Def", "Data Migration", ignore_missing=True, force=True)