Skip to content

Commit

Permalink
fix: add index for postgresql db
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Dec 1, 2023
1 parent 2461379 commit 82ba327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion insights/insights/doctype/insights_table/insights_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 82ba327

Please sign in to comment.