fix: drop old notes column from lead and prospect

(cherry picked from commit 4b13452022)
This commit is contained in:
Nabin Hait
2022-09-05 18:27:03 +05:30
committed by Mergify
parent 7bb5f6eb23
commit ded6e7f544

View File

@@ -3,7 +3,7 @@ from frappe.utils import cstr, strip_html
def execute():
for doctype in ("Lead", "Prospect"):
for doctype in ("Lead", "Prospect", "Opportunity"):
if not frappe.db.has_column(doctype, "notes"):
continue
@@ -19,3 +19,5 @@ def execute():
doc = frappe.get_doc(doctype, d.name)
doc.append("notes", {"note": d.notes, "added_by": d.modified_by, "added_on": d.modified})
doc.update_child_table("notes")
frappe.db.sql_ddl(f"alter table `tab{doctype}` drop column `notes`")