2018-09-06 13:23:31 +00:00
|
|
|
|
|
|
|
import frappe
|
|
|
|
from frappe.model.utils.rename_field import rename_field
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
for dt, dn in (("Page", "Hub"), ("DocType", "Hub Settings"), ("DocType", "Hub Category")):
|
|
|
|
frappe.delete_doc(dt, dn, ignore_missing=True)
|
|
|
|
|
2018-09-09 13:49:13 +00:00
|
|
|
if frappe.db.exists("DocType", "Data Migration Plan"):
|
|
|
|
data_migration_plans = frappe.get_all("Data Migration Plan", filters={"module": 'Hub Node'})
|
|
|
|
for plan in data_migration_plans:
|
|
|
|
plan_doc = frappe.get_doc("Data Migration Plan", plan.name)
|
|
|
|
for m in plan_doc.get("mappings"):
|
|
|
|
frappe.delete_doc("Data Migration Mapping", m.mapping, force=True)
|
|
|
|
frappe.delete_doc("Data Migration Plan", plan.name)
|
2018-09-06 13:23:31 +00:00
|
|
|
|
|
|
|
frappe.delete_doc("Module Def", "Hub Node", ignore_missing=True)
|