Add addresses contract code clear to FixContractCreationTransactions migration

fix-contract-creation-transactions
Qwerty5Uiop 2 years ago
parent 2cd44a22f0
commit 4c75167fa0
  1. 7
      apps/explorer/priv/repo/migrations/20230606091935_fix_contract_creation_transactions.exs

@ -2,6 +2,13 @@ defmodule Explorer.Repo.Migrations.FixContractCreationTransactions do
use Ecto.Migration use Ecto.Migration
def change do def change do
execute("""
UPDATE addresses a
SET contract_code = NULL
FROM transactions t
WHERE t.created_contract_address_hash IS NOT NULL AND t.created_contract_address_hash = a.hash AND t.to_address_hash IS NOT NULL;
""")
execute(""" execute("""
UPDATE transactions UPDATE transactions
SET created_contract_address_hash = NULL SET created_contract_address_hash = NULL

Loading…
Cancel
Save