fix: Update value if conflicting

This commit is contained in:
Ankush Menat 2025-11-14 10:54:38 +05:30
parent e8961aee80
commit f7e594a618

View file

@ -219,9 +219,15 @@ def insert_values_for_multiple_docs(all_contents):
# ignoring duplicate keys for doctype_name
frappe.db.multisql(
{
"mariadb": """INSERT IGNORE INTO `__global_search`
"mariadb": """INSERT INTO `__global_search`
(doctype, name, content, published, title, route)
VALUES {} """.format(", ".join(batch_values)),
VALUES {}
ON DUPLICATE KEY UPDATE
content=VALUE(content),
published=VALUE(published),
title=VALUE(title),
route=VALUE(route)
""".format(", ".join(batch_values)),
"postgres": """INSERT INTO `__global_search`
(doctype, name, content, published, title, route)
VALUES {}