         StockTransfer,
         stock_transfers,
         upsert_query,
-        {:constraint, :stock_transfers_doc_id_no_key}
+        {:unsafe_fragment, "ON CONSTRAINT stock_transfers_doc_id_no_key"}
       )
 
     {:ok, %{ctx | upserted: Map.put(ctx.upserted, :stock_transfers, rows)}}

        StockReceipt,
        records,
        upsert_query,
        {:constraint, :stock_receipts_doc_id_no_key}
      )

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

        ]
      )

    rows =
      upsert_records(
        OpStock,
        records,
        upsert_query,
        {:unsafe_fragment, "ON CONSTRAINT op_stocks_pkey"}
      )

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

