2019-01-22 18:22:20 +05:30
|
|
|
from __future__ import unicode_literals
|
2018-09-06 18:53:31 +05:30
|
|
|
|
|
|
|
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 19:19:13 +05:30
|
|
|
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)
|
2018-09-12 17:36:29 +05:30
|
|
|
docs = frappe.get_all("Data Migration Run", filters={"data_migration_plan": plan.name})
|
|
|
|
for doc in docs:
|
|
|
|
frappe.delete_doc("Data Migration Run", doc.name)
|
2018-09-09 19:19:13 +05:30
|
|
|
frappe.delete_doc("Data Migration Plan", plan.name)
|