github.com/status-im/status-go@v1.1.0/walletdatabase/migrations/sql/1706531789_remove_gasfee-only-eth-transfers.up.sql (about)

     1  --- Select all token transfers
     2  WITH token_rows AS (
     3      SELECT ROWID, *
     4      FROM transfers
     5      WHERE type != 'eth'
     6  )
     7  --- Select all 0-value transfers
     8  , eth_zero_value_rows AS (
     9      SELECT ROWID, *
    10      FROM transfers
    11      WHERE type = 'eth' AND amount_padded128hex = '00000000000000000000000000000000'
    12  )
    13  -- Select gas-fee-only ETH transfers
    14  , eth_gas_fee_only_rows AS (
    15      SELECT ROWID
    16      FROM eth_zero_value_rows
    17      WHERE (tx_hash, address, network_id, account_nonce) IN (
    18          SELECT tx_hash, address, network_id, account_nonce
    19          FROM token_rows
    20      )
    21  )
    22  
    23  DELETE FROM transfers WHERE ROWID in eth_gas_fee_only_rows;