Hi,
How I can make version doc cleanup? Version table is around 800k+ entires.
I tried this
frappe.db.delete(“Version”, {
“ref_doctype”: “***”,
“modified”: (“<”, frappe.utils.add_to_date(frappe.utils.now(), days=(keepForDays * -1)))
})
frappe.db.sql(“”"
DELETE FROM tabVersion
WHERE ref_doctype = %s
AND modified < %s
“”“, (”***", frappe.utils.add_to_date(frappe.utils.now(), days=(keepForDays * -1))))
For first code I got missing delete method. For second read-only queries.
Is there any way to delete docs from server script?