Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/apps/explorer/lib/backfill_transaction_receip...

15 lines
354 B

defmodule BackfillTransactionReceiptIds do
@moduledoc "Backfills transactions with receipt_id values"
alias Explorer.Repo
def run do
query = """
UPDATE transactions SET (receipt_id) = (
SELECT id FROM receipts WHERE receipts.transaction_id = transactions.id
);
"""
{:ok, _result} = Repo.query(query, [])
end
end