diff --git a/apps/explorer/priv/repo/migrations/20211013190346_remove_duplicates_of_current_token_balances.exs b/apps/explorer/priv/repo/migrations/20211013190346_remove_duplicates_of_current_token_balances.exs index 3f0c9a4165..ec26db4b73 100644 --- a/apps/explorer/priv/repo/migrations/20211013190346_remove_duplicates_of_current_token_balances.exs +++ b/apps/explorer/priv/repo/migrations/20211013190346_remove_duplicates_of_current_token_balances.exs @@ -35,5 +35,21 @@ defmodule Explorer.Repo.Migrations.RemoveDuplicatesOfCurrentTokenBalances do ) a ); """) + + execute(""" + UPDATE address_current_token_balances + SET token_type = t.type + FROM tokens t + WHERE address_current_token_balances.token_type IS NULL + AND t.contract_address_hash = address_current_token_balances.token_contract_address_hash; + """) + + execute(""" + UPDATE address_token_balances + SET token_type = t.type + FROM tokens t + WHERE address_token_balances.token_type IS NULL + AND t.contract_address_hash = address_token_balances.token_contract_address_hash; + """) end end