code.vegaprotocol.io/vega@v0.79.0/datanode/sqlstore/migrations/0097_update_duplicate_deposits.sql (about)

     1  -- +goose Up
     2  WITH finalized_tx AS (
     3      SELECT foreign_tx_hash AS ftx,
     4      vega_time as vt
     5      FROM deposits
     6      WHERE status = 'STATUS_FINALIZED'
     7  ) UPDATE deposits
     8  SET status = 'STATUS_DUPLICATE_REJECTED'
     9  WHERE status = 'STATUS_OPEN'
    10  AND foreign_tx_hash IN (SELECT ftx FROM finalized_tx WHERE vt < vega_time);
    11  
    12  -- +goose Down
    13  
    14  -- Nothing to do