|
|
|
@ -120,7 +120,27 @@ defmodule Explorer.Chain.Import.Runner.InternalTransactions do |
|
|
|
|
inserted_at: fragment("LEAST(?, EXCLUDED.inserted_at)", internal_transaction.inserted_at), |
|
|
|
|
updated_at: fragment("GREATEST(?, EXCLUDED.updated_at)", internal_transaction.updated_at) |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
# `IS DISTINCT FROM` is used because it allows `NULL` to be equal to itself |
|
|
|
|
where: |
|
|
|
|
fragment( |
|
|
|
|
"(EXCLUDED.call_type, EXCLUDED.created_contract_address_hash, EXCLUDED.created_contract_code, EXCLUDED.error, EXCLUDED.from_address_hash, EXCLUDED.gas, EXCLUDED.gas_used, EXCLUDED.init, EXCLUDED.input, EXCLUDED.output, EXCLUDED.to_address_hash, EXCLUDED.trace_address, EXCLUDED.transaction_index, EXCLUDED.type, EXCLUDED.value) IS DISTINCT FROM (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", |
|
|
|
|
internal_transaction.call_type, |
|
|
|
|
internal_transaction.created_contract_address_hash, |
|
|
|
|
internal_transaction.created_contract_code, |
|
|
|
|
internal_transaction.error, |
|
|
|
|
internal_transaction.from_address_hash, |
|
|
|
|
internal_transaction.gas, |
|
|
|
|
internal_transaction.gas_used, |
|
|
|
|
internal_transaction.init, |
|
|
|
|
internal_transaction.input, |
|
|
|
|
internal_transaction.output, |
|
|
|
|
internal_transaction.to_address_hash, |
|
|
|
|
internal_transaction.trace_address, |
|
|
|
|
internal_transaction.transaction_index, |
|
|
|
|
internal_transaction.type, |
|
|
|
|
internal_transaction.value |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|