diff --git a/insights/insights/doctype/insights_table/insights_table.py b/insights/insights/doctype/insights_table/insights_table.py index 2aab471cf..65a5aebc3 100644 --- a/insights/insights/doctype/insights_table/insights_table.py +++ b/insights/insights/doctype/insights_table/insights_table.py @@ -58,4 +58,7 @@ def update_column_type(self, column, newtype): def on_doctype_update(): - frappe.db.add_index("Insights Table", ["data_source", "table"], "data_source_table_index") + fields = ["data_source", "table"] + if frappe.db.db_type == "mariadb": + fields = ["`data_source`", "`table`"] + frappe.db.add_index("Insights Table", fields, "data_source_table_index")