       )
 
     rows =
-      upsert_records(Price, records, upsert_query, {:constraint, :prices_product_id_date_lmt_key})
+      upsert_records(
+        Price,
+        records,
+        upsert_query,
+        {:unsafe_fragment, "ON CONSTRAINT prices_product_id_date_lmt_key"}
+      )
 
     {:ok, %{ctx | upserted: Map.put(ctx.upserted, :prices, rows)}}
   end

        ]
      )

    rows = upsert_records(OpStock, records, upsert_query, {:constraint, :op_stocks_pkey})
    {:ok, %{ctx | upserted: Map.put(ctx.upserted, :stock_openings, rows)}}
  end


        StockReceipt,
        records,
        upsert_query,
        {:unsafe_fragment, "ON CONSTRAINT stock_receipts_doc_id_no_key"}
      )

    {:ok, %{ctx | upserted: Map.put(ctx.upserted, :stock_receipts, rows)}}
